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

creeate file named after actual date
Create a file with actual date as filename

Print a horizontal line

lotto generator
note the xargs at the end

Edit the last or previous command line in an editor then execute
If you would like to edit a previous command, which might be long and complicated, you can use the fc (I think it stands for fix command). Invoke fc alone will edit the last command using the default editor (specified by $FCEDIT, $EDITOR, or emacs, in that order). After you make the changes in the editor, save and exit to execute that command. The fc command is more flexible than what I have described. Please 'man bash' for more information.

Top 10 requestors by IP address from Apache/NCSA Logs

New files from parts of current buffer
On command mode in Vim you can save parts of the current buffer in another file. * The 'n' value represents the first line of the new file. * The 'm' value represents the last line of the new file. * newfile.txt is the newfile. The results are similar to this command in perl: $ perl -ne 'print if n..m' in.sql > out.sql

Find and copy scattered mp3 files into one directory
I used this command to recursively gather all mp3 files that were previously imported into their own directories (sorted by band name) in Songbird.

Advanced python tracing
Trace python statement execution and syscalls invoked during that simultaneously

ping a host until it responds, then play a sound, then exit
This allows for sleeping in between pings. Also, espeak needs to be installed.

Convert embedded spaces in filenames to "_" (underscore)
This command converts filenames with embedded spaces in the current directory replacing spaces with the underscore ("_") character.


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: