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:
Improved version of command #8425.
This way, the default browser is used, as opposed to Firefox.
convert a unix timestamp to a human readable format.
You can use the command "full" not only with one item, with items with diferent paths, and with relatives and absolute paths.
Had trouble with the other function, because of missing semicolons. (According to my bash on OS X)
This shows all process (-e) and threads (-L) in full format (-F)
Grab the RSS link to the Picasa album. Feed it to the script when its hungry. When its done writing the shopping list, just use
wget -c -i wgetlist
to get your stuff.
sudo is optional, but to find out about all files, it is nice, or else run as superuser, ie: su -c 'du -sm * | sort -n'
This way, you can specify how many hours in which you want your machine to shut down.
This command will :
-Archive all *.dmp files individually (one file per archive) from current directory .
-Delete original file after has been compressed.
Encrypt any text to MD5 , replace text with the string you want to convert to MD5
This will create a new file with proper code formatting and all comments removed.
Script has to be modified to be executable! SRC and DEST a relative unix path, olds and news are the terms to be modified.
Very helpful to sync source folders present in different SCM.
If you dont like this one, just use rsync...
Generate a Netscape cookies file to use with Python's mechanize.
Shows the ?rendering? for each of the 256 colours in both the bold and normal variant. Using seq is helpful to get even lines, passing $((COLUMNS*2)) to column sort-of-handles the nonprintable characters.
`pwd` returns the current path
`grep -o` prints each slash on new line
perl generates the paths sequence: './.', './../.', ...
`readlink` canonicalizes paths (it makes the things more transparent)
`xargs -tn1` applies chmod for each of them. Each command applied is getting printed to STDERR.
Backs up all databases, excluding test, mysql, performance_schema, information_schema.
Requires parallel to work, install parallel on Ubuntu by running: sudo aptitude install parallel
This command will show the sum total of memory used in gigabytes by a program that spawns multiple instances of itself. Replace chrome with whatever program's memory usage you are investigating. This command is rather useless on software that only spawns a single instance of itself.
If your CVS server has moved, here's a way to update your CVS Root files throughout your code tree without checking out a new copy of your files.
Ever had a file with a list of numbers you wanted to add, use:
cat file | sed ':a;N;$!ba;s/\n/+/g' | bc