All commands (14,020)

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.

Share Your Commands


Check These Out

gpg decrypt several files
Change directory (cd) to the directory where all your encrypted files are placed, and then run the command - then you are asked to insert your secret gpg password - ubuntu 8.04

Analyse an Apache access log for the most common IP addresses
This uses awk to grab the IP address from each request and then sorts and summarises the top 10.

check open ports without netstat or lsof

Sort movies by length, longest first
Sort .avi movies by time length, print the longest first, and so on...

send file to remote machine and unzip using ssh
This version transfers gzipped data which is unzipped as it arrives at the remote host.

Add temporary entry to authorized_keys
If you frequently need to connect to your ubersecure mainframe from various uberunsafe machines, you have to face difficult decision: (a) type the password everytime during the session (lame), (b) add local public key to mainframes authorized_keys file (unsafe), (c) as above, but remove this key at the end of the session (pain in the a55). So let's say you save The Command to tempauth file in bin directory of your mainframe's account and make it executable. Then, while you're on one of these unsafe ones, do: $ cat $HOME/.ssh/id_rsa.pub|ssh [email protected] bin/tempauth 30 and password prompts stop the harassment for 30 minutes and you don't have to care to remove the unsafe key after that.

Search gpg keys from commandline

Show a line when a "column" matchs

Stream (almost) any music track in mplayer
Just give it an artist and/or song at the end of the command as shown.

Spell check the text in clipboard (paste the corrected clipboard if you like)
xclip -o > /tmp/spell.tmp # Copy clipboard contents to a temp file aspell check /tmp/spell.tmp # Run aspell on that file cat /tmp/spell.tmp | xclip # Copy the results back to the clipboard, so that you can paste the corrected text I'm not sure xclip is installed in most distributions. If not, you can install x11-apps package


Stay in the loop…

Follow the Tweets.

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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

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: