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

flush memcached via netcat

Delete all non-printing characters from a file
tr has some predefined sets of characters that are more convenient to use than characters codes

Drop or block attackers IP with null routes
Someone might attack on your system. You can drop attacker IP using IPtables. However, you can use route command to null route unwanted traffic. A null route (also called as blackhole route) is a network route or kernel routing table entry that goes nowhere. Matching packets are dropped (ignored) rather than forwarded, acting as a kind of very limited firewall. The act of using null routes is often called blackhole filtering.

Connect to TCP port 5000, transfer data and close connexion.
With no '-q 0' switch, nc simply waits, and whatever awaits the data hangs.

Drop all tables from a database, without deleting it
Uses two comands, requieres mysqldump, but works as expected.

Using awk to sum/count a column of numbers.
Takes a input file (count.txt) that looks like: 1 2 3 4 5 It will add/sum the first column of numbers.

Download song from youtube for import into itunes (m4a format)
Last argument is the youtube link. Requires ffmpeg

E-mail a traditional Berkeley mbox to another recipient as individual e-mails.

Speed up builds and scripts, remove duplicate entries in $PATH. Users scripts are oftern bad: PATH=/apath:$PATH type of thing cause diplicate.

Download all images from a website in a single folder


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: