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:
Refresh the cache of font directory , usefull after you download font (.ttf or other) from various website and you don't want to reboot or relogin . Close your word processor before using the command , after the refresh reopen your word processor , new fonts is avaible !
The really awesome bash completion in debian seems to be an extra package now, which has to be installed. After sourcing /etc/bash_completion it completes almost everything (package names in apt... etc) :-)
To make this permanent, put something like this in your .bashrc:
if [ -f /etc/bash_completion]; then
The "-d" option for gnu's "date" command can calculate positive or negative offset from any time, including "now". You can even specify a source timezone (the output timezone can be set with the TZ environment variable). Useful! Fun! Not very well documented!
Comments can be used directly on the command line so I can save in the history a brief description of what command does.
Consider this file :
I can use awk substring to laminate words :
All output is placed in file SHA1SUMS which you can later check with 'sha1sum --check'. Works on most Linux distros where 'sha1sum' is installed.
Nicely display in html format a detailed report of the machine, including cpu benchmarks.
Found another way, more compatible. Tested with xterm, aterm, gnome-terminal and rxvt (where it sets the window title) and guake (where it doesn't - after all, guake does not show the window title).
Found the same command for zsh in http://www.davidpashley.com/articles/xterm-titles-with-bash.html - changed it a bit so that the behaviour is the same
Force an fsck on reboot. Useful on a system where / has mounted read-only because of file system issues.
Works only on Linux.
Last option (n) turn name of service resolving (/etc/services) off.
This command will dump a database on a remote stream to stdout, compress it, stream it to your local machine, decompress it and put it into a file called database.sql.You could even pipe it into mysql on your local machine to restore it immediately. I had to use this recently because the server I needed a backup from didn't have enough disk space.
Work for me on CentOS, grep and print ip addresses of ssh bruteforce attempts
"That command will encrypt the unencrypted-data.tar file with the password you choose and output the result to encrypted-data.tar.des3. To unlock the encrypted file, use the following command:"
openssl des3 -d -salt -in encrypted-data.tar.des3 -out unencrypted-data.tar
List files and pass to openssl to calculate the hash for each file.
This is very useful if you need to show someone some text from a distance. (Like someone standing over your shoulder...)
I'd recommend aliasing it to something like:
alias osd_cat="osd_cat -o 400 -s 8 -c blue -d 60 -f -*-bitstream\ vera\ sans-*-*-*--200-*-*-*-*-*-*-*"
xosd is the utility that provides osd_cat.