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

Compute the average number of KB per file for each dir
Use this to find identify if dirs mostly contain large or small files.

Summarise the size of all files matching a simple regex
Use the find command to match certain files and summarise their total size in KBytes.

delete multiple files with spaces in filenames (with confirmation)
ls -Q will show the filenames in quotes. xargs -p rm will print all the filenames piped from ls -Q and ask for confirmation before deleting the files. without the -Q switch, if we have spaces in names, then the files won't be deleted.

Test for Weak SSL Ciphers
...if you get a certificate back, the server is accepting weak SSL ciphers

Find the package that installed a command

Play ISO/DVD-files and activate dvd-menu and mouse menu clicks.

How to get an absolute value
Whenever we are only interested in difference between two numbers and not the positive/negative values we can use this in script.

Add temporary swap space
In addition to a swap partition, Linux can also use a swap file. Some programs, like g++, can use huge amounts of virtual memory, requiring the temporary creation of extra space.

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

Pulls total current memory usage, including SWAP being used, by all active processes.


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: