All commands (14,187)

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

Add all files in current directory to SVN
The --force option bypasses the warning if files are already in SVN.

Check if it's your binary birthday!
Print out your age in days in binary. Today's my binary birthday, I'm 2^14 days old :-) . This command does bash arithmatic $(( )) on two dates: Today: $(date +%s) Date of birth: $(date +%s -d YYYY-MM-DD) The dates are expressed as the number of seconds since the Unix epoch (Jan 1970), so we devide the difference by 86400 (seconds per day). . Finally we pipe "obase=2; DAYS-OLD" into bc to convert to binary. (obase == output base)

VMware Server print out the state of all registered Virtual Machines.
I use this command on my machines running VMware Server to print out the state of all registered Virtual machines.

Delete all local git branches that have been merged
This checks if the branch has been merged with master and then will delete the ones that have been. Keeps your local git repo nice and clean from all the branches.

Change display resolution
-s must be a valid resolution. You can get a list of valid (and supported) resolutions via `xrandr`.

combining streams
2>&1 permit to combinate stdout and stderr. grep will catch stderr and stdout instead of stdout only.

Check whether laptop is running on battery or cable
If you want to do the same in OS X... grep as necessary for information you need....

Write comments to your history.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.

Undo commit in Mercurial

list unique file extensions recursively for a path, include extension frequency stats
Get the longest match of file extension (Ex. For 'foo.tar.gz', you get '.tar.gz' instead of '.gz')


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: