All commands (14,184)

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

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

reclaim your window titlebars (in ubuntu lucid)

use the previous commands params in the current command
Here the !!:1 will take the first parameter from the previous command. This can be used in conjunction with other history commands like ! and so on.

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

recursive search and replace old with new string, inside files
Using -Z with grep and -0 with xargs handles file names with spaces and special characters.

move all files older than 60 days to a folder

Insert the last argument of the previous command
for example if you did a: $ ls -la /bin/ls then $ ls !$ is equivalent to doing a $ ls /bin/ls

List open TCP/UDP ports

Lock the hardware eject button of the cdrom
This command will lock the hardware eject button of your cdrom drive. Some uses are: 1: If you have a toddler and has discovered the cdrom button 2: If you are carrying a laptop in a bag or case and don't want it to eject if the button is inadvertently pressed. To unlock the button use: $ eject -i 0

vmstat/iostat with timestamp
Also useful with iostat, or pretty much anything else you want timestamped.


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: