Commands by poffey21 (1)

What's this? 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

Quickly create an alias for changing into the current directory
Put the function in your .bashrc and use "map [alias]" to create the alias you want. Just be careful to not override an existing alias.

Add forgotten changes to the last git commit
It's pretty common to forgot to commit a files, be it a modification, or a brand new file. If you did forget something, git add the files you want, and then git commit --amend. It will essentially redo the last commit, with the changes you just added. It seeds the commit message with the last commit message by default. You probably shouldn't do this if you've already pushed the commit.

Pimp your less
# s = combine multiple lines of whitespace into 1 # x4 = set the tabstop to 4 instead of 8 # F = Exit if the output fits on 1 screen. This is similar to git diff # R = Raw control chars. This allows you to pipe colordiff straight to less. ie: alias sdi="svn diff | colordiff | less" # S = Chop off long lines # X = Dont send termcap init and deinit scrings to the terminal

check open ports without netstat or lsof

Generate SHA1 hash for each file in a list
List files and pass to openssl to calculate the hash for each file.

remove all spaces from all files in current folder

Change SSH RSA passphrase
Protects your secret identity with a passphrase. OSX 10.6 automatically does key forwarding and can store the passphrase in the keychain. For other OSes, use ssh -A or set ForwardAgent in ssh_config to enable forwarding. Then use ssh-agent/ssh-add.

To get the CPU temperature continuously on the desktop
No need for a colon, and one less semicolon too. Also untested.

Use /dev/full to test language I/O-failsafety
The Linux /dev/full file simulates a "disk full" condition, and can be used to verify how a program handles this situation. In particular, several programming language implementations do not print error diagnostics (nor exit with error status) when I/O errors like this occur, unless the programmer has taken additional steps. That is, simple code in these languages does not fail safely. In addition to Perl, C, C++, Tcl, and Lua (for some functions) also appear not to fail safely.

Get MX records for a domain

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.


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: