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

ThePirateBay.org torrent search
usage: tpb searchterm example: tpb the matrix trilogy This searches for torrents from thepiratebay and displays the top results in reverse order, so the 1st result is at the bottom instead of the top -- which is better for command line users

read a file line by line and perform some operation on each line
see sample output

burn backed up xbox 360 games
burn all those sweet iso's from the command line. replace speed=2 with more if your media supports it and you're brave!

Port scan a range of hosts with Netcat.
Simple one-liner for scanning a range of hosts, you can also scan a range of ports with Netcat by ex.: nc -v -n -z -w 1 192.168.0.1 21-443 Useful when Nmap is not available:) Range declaration like X..X "for i in {21..29}" is only works with bash 3.0+

Binary search/replace
Replace all instances of "A" with "B" in file "source" saved as file "destination". !! IF A/B is multi-byte, then separate bytes with spaces like so: "s/20\ 0A/00/g".

Tail a log-file over the network
it also works with the chrome browser. The alternative with tail and nc doesn't

Play music from youtube without download
same as above but dumps the stream to a file.

list block devices
Shows all block devices in a tree with descruptions of what they are.

start vim in diff mode
vim will open both files side by side and show colored diffs

Find
A lot of X applications accept --geometry parameter so that you can set application size and position. But how can you figure out the exact arguments for --geometry? Launch an application, resize and reposition its window as needed, then launch xwininfo in a terminal an click on the application window. You will see some useful window info including its geometry.


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: