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:
I used this (along with a modified one replacing `mkv` with `srt`) to remove the slight differences in who the provider of the video / matching subtitle was (as they are the same contents and the subs match anyway).
So now VLC (and other video players) can easily guess the subtitle file.
A nice way to interrupt a sleep with a signal.
This commands compresses the "tmp" directory into an initrd file.
this command extracts an initrd files into the "tmp" directory
this command can be added to crontab so as to execute a nightly backup of directories and store only the 10 last backup files.
Mac have direct conversion of seconds (Epoch time)
credit shall fall to this for non-gzipped version:
Its possible to user a simple regex to extract de username from the finger command.
The final echo its optional, just for remove the initial space
Creates a 2 second video clip from an image.
Caution: distructive overwrite of filenames
Useful for concatenating pdfs in date order using pdftk
Works great on Mac OSX.
Reduced to only one command. :)
Autocomplete from .ssh/config
Applies 'docker rm' to all container IDs that appear in 'docker ps -a' but not in 'docker ps' - i.e. the ones that are not running.