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:
U have to make key exchange in order to avoid continuous password prompt.
while [ 1 -ne 6 ]; do
pid=`ps -ef | grep -v "grep" | grep "trans_gzdy" | cut -c10-17`
ps gv $pid | head -2
check changes of RSS.
arguably better than using the driver interface. lots of potentially cool stuff to be done w/ the dcop client.
Handy for those times you need to paste a file path in an IDE or some other app.
sudo apt-get install xclip
Then, for convenience, alias xclip to 'xclip -selection c' so you can just do something like realpath . | xclip
If you want to display a dialog (using xdialog/kdialog/zenity) you
need to make sure that you have a valid X session. Checks for
the existence of the DISPLAY variable.
nmap accepts a wide variety of addressing notation, multiple targets/ranges, etc.
e.g. if rm is aliased for 'rm -i', you can escape the alias by prepending a backslash:
rm [file] # WILL prompt for confirmation per the alias
\rm [file] # will NOT prompt for confirmation per the default behavior of the command
Change the -p argument for the port number. See "man nmap" for different ways to specify address ranges.
Just run the command, type your password, and that's the last time you need to enter your password for that server.
This assumes that the server supports publickey authentication. Also, the permissions on your home dir are 755, and the permissions on your .ssh dir are 700 (local and remote).
If you come from a DOS background and accidentally use DOS commands often, this and others like it can be helpful. Add to your .bash_profile, or wherever you keep such things.
Insert the last argument to the previous command
this is very useful when there is a different network host to determine which are turned on or not
You'll need to make sure your xorg.conf permits a virtual screen size this big. If it doesn't then xrandr should return a suitable error message that tells you the required size.
This command creates a rar archive from all files in the current folder and names the archive after the folder name.
waste the band width
Very useful for rerunning a long command changing some arguments globally.
As opposed to ^foo^bar, which only replaces the first occurrence of foo, this one changes every occurrence.
Useful for massive files where doing a full diff would take too long. This just runs diff on the first 500 lines of each. The use of subshells to feed STDIN is quite a useful construct.
Return the current shell. It is better than print $SHELL which can sometimes return a false value.
Add @mail.com each line of a list