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

Sort on multiple dis-contiguous keys/fields (can even specify key number/field from the end)
Notes: 1) -n-1 means sort key is the last field 2) -l is important if each separate record is on a new line (usually so for text files) 3) -j tells msort not to create log file (msort.log) in the working directory 4) may need to install msort package. 5) msort does lot more. Check man msort

list block devices
Shows all block devices in a tree with descruptions of what they are.

32 bits or 64 bits?
Easy and direct way to find this out.

Get length of current playlist in xmms2

Linux clear restrictions of a user's password
Command that clears the expiration restrictions of a user's password

list all file extensions in a directory
If your grep doesn't have an -o option, you can use sed instead.

clean up memory on linux
where proc filesystem mounted under /proc

Exit shell faster
Use ^D instead of exit. Also ^D ends input stream when you use terminal for typing into standard input.

Selecting a random file/folder of a folder
Also looks in subfolders

Update twitter with Perl
Requires Net::Twitter. Just replace the double quoted strings with the appropriate info.


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: