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

ROT13 using the tr command

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

Check motherboard manufacturer, product name, version and serial number
Very slick way to check your motherboard manufacturer, product name, version and serial number.

Delete line number 10 from file
Very useful when the ssh key of a host has changed and ssh refuses to connect to the machine, while giving you the line number that has changed in ~/.ssh/known_hosts.

Find directories under home directory with 777 permissions, change to 755, and list them on console

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"

Quickest way to sort/display # of occurences

determine if tcp port is open
for udp nmap -sU -p 80 hostname

Create a DOS floppy image
mount with: mount -t msdos -o loop ./floppy.img /tmp/mnt

find files in a date range
Find files in a specific date range - in this case, the first half of last year. -newermt = modification time of the file is more recent than this date GNU find allows any date specfication that GNU date would accept, e.g. $ find . -type f -newermt "3 years ago" ! -newermt "2 years ago" or $ find . -type f -newermt "last monday"


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: