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

Create a random file of a certain, and display progress along the way.
SIZE is the number of gigabytes and the file name is at the end. Random data is generated by encrypting /dev/zero, similar to other techniques posted on here.

Concatenate (join) video files
Use mencoder to concatenate (join) multiple video files together.

grep for minus (-) sign
Use flag "--" to stop switch parsing

useful tail on /var/log to avoid old logs or/and gzipped files
with discard wilcards in bash you can "tail" newer logs files to see what happen, any error, info, warn...

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.

Visit wikileaks.com
Who needs a DNS server

send a circular

Selecting a random file/folder of a folder
random file from files in directory

Averaging columns of numbers
This example calculates the averages of column one and column two of "file.dat". It can be easily modified if other columns are to be averaged.

Quickly add user accounts to the system and force a password change on first login
This command is a bit Linux specific, as --stdin doesn't exist for passwd on many Unix machines. Further, useradd is high level in most distributions and Unix derivatives except for the Debian family of distros, where adduser would be more appropriate. The last bit, with chage, will force the user to change their password on new login.


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: