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

list with full path

Take screenshot through SSH
When connected to a box via ssh you can do a quick screenshot of that box using this command. After that you can rscp it over to your box and look at it.

Unix commandline history substitution like ^foo^bar BUT for multiple replacements
#1 You invoked a command chain. #2 You globaly replace the scriptnames and execute them direct #3 The new executed command chain [# ^foo^bar] would only replace the firts match [foo] with [bar].

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Indent all the files in a project using emacs
use -iname \*[.ch] instead of -iname \*.c -o -iname \*.h

Find the package that installed a command
Put this one-line function somewhere in your shell init, re-login and try $ whatinstalled This is an elaborate wrapper around "dpkg -S", with numerous safeguards. Symlinks and command aliases are resolved. If the searched command is not an existing executable file or was installed by some other means than dpkg/apt, nothing is printed to stdout, otherwise the package name.

Get all possible problems from any log files
Using the grep command, retrieve all lines from any log files in /var/log/ that have one of the problem states

Capture all plaintext passwords

Go up multiple levels of directories quickly and easily.
Change to your taste. Much quicker than having to add 'cd' every time. Add it to your .bashrc or .bash_profile.

connects to a serial console
e.g., 'screen -L /dev/ttyUSB0 38400' listens to your Holux M-241 GPS logger and turns on automatic logging


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: