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

Change the case of a single word in vim
In edit mode, toggle the case of a single word under the cursor in vim.

ls -qahlSr # list all files in size order - largest last
I find it useful, when cleaning up deleting unwanted files to make more space, to list in size order so I can delete the largest first. Note that using "q" shows files with non-printing characters in name. In this sample output (above), I found two copies of the same iso file both of which are immediate "delete candidates" for me.

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

xargs for builtin bash commands

Backup all databases in a MySQL container

Find all clients connected to HTTP or HTTPS ports
It finds, specifically, the connections to the HTTP and HTTPS ports as source ports. You can check for destination ports as well.

List manually installed packages (excluding Essentials)

eth-tool summary of eth# devices
Give the Speed and Link status of eth# 0-3. This is sort of what mii-tool does, but eth-tool is better, yet lacks device discovery.

Generate a (compressed) pdf from images
use imagemagik convert

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


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: