Commands by ajrobinson (2)

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

Extract public key from private
This will extract the public key that is stored in the private key using openssl.

Get all upgradable deb packages in a single line
Works for debian and ubuntu based distros.

list block devices
Shows all block devices in a tree with descruptions of what they are.

list block devices
Shows all block devices in a tree with descruptions of what they are.

display a one-liner of current nagios exit statuses. great with netcat/irccat

list block devices
Shows all block devices in a tree with descruptions of what they are.

Copy all documents PDF in disk for your home directory
I used this to copy all PDFs recursively to a selected dir

Get just the IP for a hostname

Create a persistent connection to a machine
Create a persistent SSH connection to the host in the background. Combine this with settings in your ~/.ssh/config: Host host ControlPath ~/.ssh/master-%r@%h:%p ControlMaster no All the SSH connections to the machine will then go through the persisten SSH socket. This is very useful if you are using SSH to synchronize files (using rsync/sftp/cvs/svn) on a regular basis because it won't create a new socket each time to open an ssh connection.

clear screen, keep prompt at eye-level (faster than clear(1), tput cl, etc.)
this leaves the cursor at the bottom of the terminal screen, where your eyes are. ctrl-l moves it to the top, forcing you to look up.


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: