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

Alternative way to generate an XKCD #936 style 4 word password usig sed
This is what I came up to generate XKCD #936 style four-word password. Since first letter of every word is capitalized it looks a bit more readable to my eyes. Also strips single quotes. And yes - regex is a bit of a kludge, but that's the bes i could think of.

Build an exhaustive list of maildir folders for mutt
Of course, you can adjust "Maildir" to your config...

show how many regex you use in your vim today
i want to count how many regex code i have used in vim in a long time so i make a directory in svn host and post record to this directory of course i dont want to post manually so i worte a script to do that and this is the core thing to do

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

keylogger
$python -c "DEV = '/dev/input/event4' #if event0 doesn't work, try event1 event2 etc fo = open(DEV) def interpret(keycode,state): if state == 0: print '%i up'%keycode if state == 1: print '%i down'%keycode if state == 2: print '%i repeat'%keycode while 1: line = fo.read(16) if ord(line[10]) != 0: keycode,state = line[10],line[12] interpret(ord(keycode),ord(state)) "

Calculate the distance between two geographic coordinates points (latitude longitude)
The Haversine formula determines the great-circle distance between two points on a sphere given their longitudes and latitudes.

Create md5sum of files under the current dir excluding some directories
Useful if you want get all the md5sum of files but you want exclude some directories. If your list of files is short you can make in one command as follow: $ find . -type d \( -name DIR1 -o -name DIR2 \) -prune -o -type f -exec md5sum {} \; Alternatively you can specify a different command to be executed on the resulting files.

Top 10 Memory Processes
It displays the top 10 processes sorted by memory usage

Query Wikipedia via console over DNS
Shorter version, works with multiple words.

Identify name and resolution of all jpgs in current directory


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: