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

Remove security limitations from PDF documents using QPDF
Remove security restrictions from PDF documents using this very simple command on Linux and OSX. You need QPDF installed (http://qpdf.sourceforge.net/) for this to work.

Make vim open in tabs by default (save to .profile)
I always add this to my .profile rc so I can do things like: "vim *.c" and the files are opened in tabs.

list all files in a directory, sorted in reverse order by modification time, use file descriptors.
It's both silly, and infinitely useful. Especially useful in logfile directories where you want to know what file is being updated while troubleshooting.

Convert control codes to visible Unicode Control Pictures
Converts control codes and spaces (ASCII code ≤ 32) to visible Unicode Control Pictures, U+2400 ? U+2420. Skips \n characters, which is probably a good thing.

How to run a command on a list of remote servers read from a file
dsh - Distributed shell, or dancer?s shell ;-) you can put your servers into /etc/dsh/machines.list than you don't have to serperate them by commata or group them in different files and only run commands for this groups dsh -M -c -a -- "apt-get update"

Rename files in batch

grep certain file types recursively
-exec works better and faster then using a pipe

Check if system is 32bit or 64bit
Needed a quick way to see if my server distro that I setup years ago was running 32bit or not, since with time I had forgotten. Note: does not check _hardware_ e.g. /proc/cpuinfo but rather the kernel installed

Decode a MIME message
will decode a mime message. usefull when you receive some email and file attachment that cant be read.

Copy a file using dc3dd and watch its progress (very nice alternative to dd)
Requires the dc3dd package - available at http://dc3dd.sourceforge.net


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: