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

Find the package that installed a command

"at" command w/o the resource usage/competition issues
EXAMPLES jb "next sun 12pm" "/bin/sh ~you/1.sh" & jb "2010-08-29 12:00:00" "~you/1.sh" & jb "29aug2010 gmt" ". ~you/1.sh" & jb 12:00p.m. "nohup ./1.sh" & jb 1min "echo stop!" & SEE ALSO parsedate(3) strftime(3)

Determine MAC address of remote host when you know its IP address
arping sends ARP requests to a neighboring host. This won't work if there is an ARP subnet gateway in the middle. If there is, you'll just get the gateway's MAC address not the host's address you are really trying to get to.

Use wget to download one page and all it's requisites for offline viewing

Display summary of git commit ids and messages for a given branch
Useful when quickly looking for a commit id from a branch to use with git cherry-pick.

pip install into current directory without virtualenv
For subsequent commands in the prefixed path: $ PYTHONPATH=$PWD/lib/python*/site-packages ./bin/pip --version

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"

To print a specific line from a file
You can get one specific line during any procedure. Very interesting to be used when you know what line you want.

Print permanent subtitles on a video
It prints myvideo.srt subtitle files in myvideo.avi, saving it in myvideo_subtitled.avi

Show last changed files in a directory
This will quickly display files last changed in a directory, with the newest on top.


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: