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 curl with a local SOCKS5 proxy (e.g. Tor)
Routes curl input through a local SOCKS5 proxy; in this case, anonymizes curl activity via The Onion Router (Tor) proxy running locally. Note that the traffic will be anonymized, but it will NOT be encrypted, so your traffic will be very vulnerable to man-in-the-middle attacks.

exclude file(s) from rsync
rsyncs files to a server excluding listed files also a file can be used to exclude common exclude rules and/or to exclude a ton of files, like so: $rsync --exclude-from '~/.scripts/exclude.txt' where exclude.txt has one rule per line: *.mp3 *.svn*

find files beginning with filename* that do not include "string"
Inverse grep, to find files without the string

Welcome humans!
Some information about robots. :-)

DVD-Rip
Make backups of your home DVDs easily. Other: mencoder dvd://1 -o "$targetDir/$dvdTitle.avi" -aid "$audioID" -ovc x264 -x264encopts qp=26:frameref=3:bframes=15:direct_pred=auto:cabac:weight_b:partitions=all:8x8dct:me=esa:me_range=24:subq=7:mixed_refs:trellis=2:bitrate=1000:nofast_pskip:threads=0 -oac mp3lame

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

Display ncurses based network monitor
Nload is part of nload package, tested under Debian. Nload display network bandwidth statistics, -u m options stands for MBit unit measure.

Replace spaces in filenames with underscores
It's the rename-tool from debians perl-package.

Save man pages to pdf

Create a file server, listening in port 7000
At client side: tar c myfile | nc localhost 7000 ##Send file myfile to server tar c mydir | nc localhost 7000 ## Send directory mydir to server


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: