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

use google's text-to-speech and play in media player

convert chinese character into wubi86 input code
This CLI requiere the uniconv package that is provided with the yudit unicode editor . The wubi86 is a way to type chinese far quicker than pinyin . More infor on wikipedia : http://en.wikipedia.org/wiki/Wubizixing , http://www.yale.edu/chinesemac/wubi/xing.html

Instant mirror from your laptop + webcam (fullscreen+grab)
This directly puts the "mirror" into fullscreen, and lets you take photos by pressing the 's' key. I bet appearance conscious people will have keyboard shortcut for this command by now.

check open ports without netstat or lsof

Search for a word in less
Although less behaves more or less like vim in certain aspects, the vim regex for word boundaries (\< and \>) do not work in less. Instead, use \b to denote a word boundary. Therefore, if you want to search for, say, the word "exit", but do not want to search for exiting, exits, etc., then surround "exit" with \b. This is useful if you need to search for specific occurrences of a keyword or command. \b can also be used at just the beginning and end, if needed.

change up n directories
Change n directories up, without parameters change one up

Simple top directory usage with du flips for either Linux or base Solaris
No need to type out the full OR clause if you know which OS you're on, but this is easy cut-n-paste or alias to get top ten directories by singleton. To avoid the error output from du -xSk you could always 2>/dev/null but you might miss relevant STDERR.

use wget to check if a remote file exists
put your link [url] to check if exist the remote file

Find out how old a web page is
I used to use the Firefox "View page info" feature a lot to determine how stale the web page I was looking at was. Now that I use mostly Chrome I miss that feature, so here is a command line alternative using wget. The -S says to display the server response, the --spider says to not download any files/pages, just fetch the header. The output goes to stderr, so to grep it you use 2>&1 to combine the stderr stream with stdout, the pipe that to grep for Last-Modified. You can use curl instead if you have it installed, like this: $ curl --head -s http://osswin.sourceforge.net | grep Mod

Create a bunch of dummy files for testing
Sometimes I need to create a directory of files to operate on to test out some commandlinefu I am cooking up. The main thing is the range ({1..N}) expansion.


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: