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

List the binaries installed by a Debian package
GNU grep's perl-compatible regular expression(PCRE).

Tricky implementation of two-dimensional array in Bash.
Since Bash doesn't support two-dimensional arrays, you can limit your columns length by some big enough constant value ( in this example 100 ) and then index the array with i and j, or maybe write your own get() and set() methods to index the array properly like I implemented for example ( see Sample output ). For example for i=0 and j=0...99 you'll pick up one of 100 elements in the range [0,99] in the one-dimensional array. For i=1 and j=0...99 you'll pick up one of 100 elements in the range [100,199]. And so on. Be careful when using this, and remember that in fact you are always using one-dimensional array.

Find today created files

use screen as a terminal emulator to connect to serial consoles
Use GNU/screen as a terminal emulator for anything serial console related. screen /dev/tty eg. screen /dev/ttyS0 9600 MacOSX: http://www.macosxhints.com/article.php?story=20061109133825654 Cheat Sheet: http://www.catonmat.net/blog/screen-terminal-emulator-cheat-sheet/

pretend to be busy in office to enjoy a cup of coffee
Dialog's gauge widget accepts progress updates on stdin. This version runs dialog once and updates it every second. There's no need to use timeout which causes screen flicker since it restarts dialog for each update.

Install pip with Proxy
Installs pip packages defining a proxy

whois surfing my web ?

ps with parent/child process tree
Shows a tree view of parent to child processes in the output of ps (linux). Similar output can be achieved with pstree (also linux) or ptree (Solaris).

Print the detailed statistics of transferred bytes by the firewall rules

Clear ARP table in linux.
Clears the "arp" table, without entering manually addresses (tested in Ubuntu).


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: