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

Match a URL
For the record: I didn't build this. Just shared what I found that worked. Apologies to the original author! I decided I should fix the case where http://example.com is not matched for the next time I need this. So I read rfc1035 and formalized the host name regex. If anyone finds any more holes, please comment.

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Resets your MAC to a random MAC address to make you harder to find.
Next time you are leaching off of someone else's wifi use this command before you start your bittorrent ...for legitimate files only of course. It creates a hexidecimal string using md5sum from the first few lines of /dev/urandom and splices it into the proper MAC address format. Then it changes your MAC and resets your wireless (wlan0:0).

Install pip with Proxy
Installs pip packages defining a proxy

check open ports without netstat or lsof

See system users

Compress a series of png pictures to an avi movie.
cd /path/to/your/png_pics mencoder "mf://*.png" -mf fps=2 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4 then you can get a movie named output.avi.

show current directory
Opens a file or URL in the user's preferred application.

Manually Pause/Unpause Firefox Process with POSIX-Signals
Continue with: $killall -CONT -m firefox Suspends all Firefox Threads. Results in Zero CPU load. Useful when having 100+ Tabs open and you temporarily need the power elsewhere. Be careful - might produce RACE CONDITIONS or LOCKUPS in other processes or FF itself. matching is case sensitive.

In (any) vi, add a keystroke to format the current paragraph.
That goes into your $HOME/.exrc file. " Nice macro to reformat lines: map ^A !}fmt Note that the ^A has to be input by typing ^V^A.


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: