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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
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.
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:
Only excludes .svn from filenames.
Open a terminal (urxvt in this case) to connect to a screen session (named "main") and create the screen session if necessary.
Ping machine once, waiting 1 second for response until failing. Upon fail, ssh globally, otherwise ssh locally.
Returns the pathnames of the files which would be executed in the current environment had its arguments been given as a command.
Variant of find grep that ignores files with .svn in the name. Useful for searching through a local repository of source code.
now you can acces the website by going to http://localhost:2001/
Replace and accordingly.
bash/ksh subshell redirection (as file descriptors) used as input to diff
Good for one off jobs that you want to run at a quiet time. The default threshold is a load average of 0.8 but this can be set using atrun.
Useful in scripts when the file is passed in as an argument. Eg.
Useful for checking if there are differences between local and remote files.
This decompresses the file and sends the output to STDOUT so it can be grepped. A good one to put in loops for searching directories of gzipped files, such as man pages.
Useful for getting to know the available keyboard shortcuts.
sometimes you got conflicts using SSH (host changing ip, ip now belongs to a different machine) and you need to edit the file and remove the offending line from known_hosts. this does it much easier.
This is useful for keeping an eye on an error log while developing. The !^ pulls the first arg from the previous command (which needs to be run in a sub-shell for this shortcut to work).
This appends (-A) a new rule to the INPUT chain, which specifies to drop all packets from a source (-s) IP address.