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

Adding Prefix to File name
Good old bracket expansion :-) For large numbers of files, "rename" will spare you the for-loop, or the find/exec...

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"

Count threads of a jvm process
if you have problem threads problem in tomcat

List the number and type of active network connections

automount samba shares as devices in /mnt/
the middle command between the ; and ; is the vi commands that insert that line into the last line of the file, the esc with the carets is literally hitting the escape key, you have to have the smbfs package installed to do it, I use it to access my iTunes music on my mac from my linux PC's with amarok so I can play the music anywhere in the house. among other things, it allows you to access the files on that share from your computer anytime you're on that network.

Change pidgin status
Thanks for the comment oshazard, i wasn't aware of purple-remote existence.

files and directories in the last 1 hour
added alias in ~/.bashrc alias lf='find ./* -ctime -1 | xargs ls -ltr --color'

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

Rename files in batch

(DEBIAN-BASED DISTROS) Find total installed size of packages given a search term
Replace \-dev with whatever you wanna search for


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: