commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
This is a minor variation to cowboy's submission - his script worked great on Ubuntu, but the sed gave issues on osx (which used BSD). Minor tweaks (sed -E instead of sed -r and \'$'\n to handle the new line made it work.
Specify the size in bytes using the 'c' option for the -size flag. The + sign reads as "bigger than". Then execute du on the list; sort in reverse mode and show the first 10 occurrences.
This command lists all the directories in SEARCHPATH by size, displaying their size in a human readable format.
First column is number of photos, second column is the focal length.
netstat has two lines of headers:
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
Added a filter in the awk command to remove them
When you press TAB twice in your prompt, bash tells you something like
"Display all 4567 possibilities? (y or n)"
But when you press "y" you only get the list in the terminal output and, if you want to save it to a file, you have to copy it by hand from the vterm screen. With this utility you save the list to a file or pipe it to another command at will
You can use the file saved list to grep for a particular pattern, useful if you are searching for a command but you only remember a few letters
Prints all the lines in /etc/passwd belonging to users with a duplicated uid. It also adds the hostname to the beginning of the line.
It's been tested in AIX, Solaris and Linux.
Useful for checking the number and state of TCP connections.
We can get useful statistics from tcpdump with this simple command.
Thanks "Babak Farrokhi" to teaching me this ;)
Shows the full output of lsof.
Useful after a complete system update (without a new kernel) when you want to know, which processes need to be restarted
List all MAC addresses on a Linux box. sort -u is useful when having virtual interfaces.