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

Stop and continue processing on a terminal
This will send the ASCII sequence for DC3 to the currently running tty which results in SIGSTOP (19). You can continue with ASCII sequence for DC1 by pressing CTRL+q which results in SIGCONT (18).

Perl Command Line Interpreter
My Programming Languages professor assigned my class a homework assignment where we had to write a Perl interpreter using Perl. I really like Python's interactive command line interpreter which inspired this Perl script.

Gives you what's between first string and second string included.
If the file content is : - Blah blah blah ABC hello blah blah blah bloh bloh bloh DEF Bah bah bah - You'll get: - ABC hello blah blah blah bloh bloh bloh DEF

Convert ascii string to hex
If you're going to use od, here's how to suppress the labels at the beginning. Also, it doesn't output the \x, hence the sed command at the end. Remove it for space separated hex values instead

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"

remove newlines from specific lines in a file using sed

Find usb device
I often use it to find recently added ou removed device, or using find in /dev, or anything similar. Just run the command, plug the device, and wait to see him and only him

Make changes in .bashrc immediately available
Any changes to BASH shell made in .bashrc will be active in the current terminal window from the moment you execute this command, ie. aliases, prompt settings etc. No need to restart terminal. (In BASH 'source' simile to 'eval' lets you generally execute any bunch of commands stacked in a text file).

Quick notepad
Quick write some notes to a file with cat. Ctrl+C when you have finish.

doing some floating point math


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: