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 SHIFT + ALT to toggle between two keyboard layouts
change the last two-character abbreviation to any layout abbreviation you want. This command will only run in the current session, add to your ~/.bashrc to make this permanent.

Display formatted routes

Advanced python tracing
Trace python statement execution and syscalls invoked during that simultaneously

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Extract multiple tar files at once in zsh
tar doesn't support wildcard for unpacking (so you can't use tar -xf *.tar) and it's shorter and simpler than for i in *.tar;do tar -xf $i;done (or even 'for i in *.tar;tar -xf $i' in case of zsh) -i says tar not to stop after first file (EOF)

Runs a command without hangups.
The improvement is that you can re-attach to the screen at a later point.

Display disk partition sizes
Use lsbk (list block) and jq (to manipulate a JSON on the command line) to display partition information:

use xxd to create the wake on lan magicpacket and write to pcap file
just set macdst to the mac address of the system you wish to wake up, the macsrc is optional but helps use tcpreplay to broadcast or wireshark to view

An alternative to: python -m SimpleHTTPServer for Arch Linux
An alternative to: python -m SimpleHTTPServer for Arch Linux source: http://archlinux.me/dusty/2010/01/15/simplehttpserver-in-python-3/

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"


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: