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

cat a bunch of small files with file indication
If you have a bunch of small files that you want to cat to read, you can cat each alone (boring); do a cat *, and you won't see what line is for what file, or do a grep . *. "." will match any string and grep in multifile mode will place a $filename: before each matched line. It works recursively too!!

remote-pbzip2 and transfer a directory to local file

vi - Change only whole words exactly matching 'http' to 'git'; ask for confirmation.
http://vim.wikia.com/wiki/Search_and_replace github anda limando feo ....: https://groups.google.com/forum/?fromgroups#!topic/symfony2/YL1mo_cz4Ms

First file editor for newbies
This command should be the first file-editing command for a newbie. It clears file.txt (cat), and asks for input until EOF is entered on its own line (not written to file.txt).

awk change field separator
GNU Awk 3.1.4

play audio stream and video stream in two different mplayer instances
Sometimes audio and video are not sync'ed. The factor 1.0884 is the quotient 48000/44100. One mplayer plays the audio file in the background, the other the video in the foreground. You can dump the audio file before with another commandlinefu

Attach screen over ssh
Directly attach a remote screen session (saves a useless parent bash process)

Getting information about model no. of computer
This command gives a model information of a computer. Also useful in determining the host is a VM machine or actual physical machine.

Given process ID print its environment variables
Same as previous but without fugly sed =x

Let your computer lull you to sleep
Can change language and speed, see espeak man page for options. (Install espeak in your linux distro via yum or apt-get) For insomniacs you may need to enclose in a while true; do ...; done loop ;)


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: