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

ignore .DS_Store forever in GIT
With a couple of little commands, you?ll be able to ignore the .DS_Store files forever from your git repositories on mac! The following command will add the .gitignore file to the git configuration git config --global core.excludesfile ~/.gitignore then, the following, will add the .DS_Store to the list echo .DS_Store >> ~/.gitignore

vi a remote file
notice the double slash

rsync...

get time in other timezones
On Ubuntu, if tzwatch is installed, then you can call up in terminal the output for every time zone configured in gWorldClock.

list files in mtime order
Simple but useful; list files in the current directory in mtime order. Useful if you've been working on something and then take a day or two off.

Copy structure
Clone directory structure without the files

generate 30 x 30 matrix
or $ od /dev/urandom -w60 -An|sed 's/ ..../ /g'|head -n 30 (this one lacks digits 8 and 9)

Delicious search with human readable output
You can install filterous with $ sudo apt-get install libxslt1-dev; sudo easy_install -U filterous

Oneliner to get domain names list of all existing domain names (from wikipedia)
Quietly get a webpage from wikipedia: curl -s By default, don't output anything: sed -n Search for interesting lines: /<tr valign="top">/ With the matching lines: {} Search and replace any html tags: s/<[^>]*>//g Finally print the result: p

Automatically skip bad songs in your MPD playlist.
Case insensitive. Also you can pull in the songs from a blacklist, one per line - while :; do (mpc current | grep -i -f blacklist.txt && mpc next); sleep 5; done


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: