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:
Use case: folder with flac files with tree structure ../artist/album/number-title.flac
1) convert flac->mp3 in the same folder: http://www.commandlinefu.com/commands/view/6341/convert-all-.flac-from-a-folder-subtree-in-192kb-mp3
2) search for mp3 files and recreate tree structure to another path: http://www.commandlinefu.com/commands/view/8853/copy-selected-folder-found-recursively-under-src-retaining-the-structure
3) move all mp3 files to that new folder: this command
This command lists all the directories in SEARCHPATH by size, displaying their size in a human readable format.
There's nothing particularly novel about this combination of find, grep, and wc, I'm just putting it here in case I want it again.
Calc the rough time from Twitter. Now with leading Zeroes.
This combines @zurvollenstunde's hourly tweets and the "n minutes ago" from Twitter search.
to be executed from root. this works well on most commercial unix systems, have not tried on linux systems.
I have some problems with gnome panel which does not load completely leaving me without the actual GUI. This commands helps to kill the gnome-panel process then it should be relaunch automatically.
This example command fetches 'example.com' webpage and then fetches+saves all PDF files listed (linked to) on that webpage.
[*Note: of course there are no PDFs on example.com. This is just an example]
Original submitter's command spawns a "grep" process for every file found. Mine spawns one grep with a long list of all matching files to search in. Learn xargs, everyone! It's a very powerful and always available tool.
Undo accidental file add to mercurial.
This command undo file adds to all recent adds
urldecode files in current directrory
An advanced possibility to count the lines of code like in #8394
it recursively searches your project's directories and sum the lines of every source [.c or .h]. Then it gives you the total.
rename file name with fixed length nomeric format pattern
Renames all files in a directory named foo to bar.
foobar1 gets renamed to barbar1
barfoo2 gets renamed to barbar2
fooobarfoo gets renamed to barobarfoo
NOTE: Will break for files with spaces AND new lines AND for an empty expansion of the glob '*'
Command to install everything on a debian based system with the prefix you indicate.