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

Count number of files in a directory
Just want to post a Perl alternative. Does not count hidden files ('.' ones).

Recursively lists all files in the current directory, except the ones in '.snapshot' directory
This can be useful for those who have mounted NetApp file-systems with snapshot activated.

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

One-liner to generate Self-Signed SSL Certificate+Key without any annoying prompts or CSRs
Handy if you want to quickly generate a self-signed certificate. Also can be used in your automated scripts for generating quick-use certificates.

Mount proc
Run this in / in a chroot to get your own proc there.

Get just the IP for a hostname
has the benefit of being a bit more cross-platform.

Replace underscores with spaces in filenames and dirnames, recursively into subdirs.
Everyone wants to take spaces out of filenames. Forget that. I want to put them back in. We've got tools and filesystems that support spaces, they look better, so I'm going to use them. Because of how find works I find I need to run this multiple times, if it's renaming subdirs. But it can be re-run without issues. I got this version of the command from a comment in this underscore-generating command. http://www.commandlinefu.com/commands/view/760/find-recursively-from-current-directory-down-files-and-directories-whose-names-contain-single-or-multiple-whitespaces-and-replace-each-such-occurrence-with-a-single-underscore. All I did was change the regex.

Search shoutcast web radio by keyword
Searches for web radio by submitted keyword and returns the station name and the link for listing . May be enhanced to read user's selection and submit it to mplayer.

Sysadmin day date of any given year
Calculate the date of Sysadmin day (last Friday of July) of any given year

Manipulate the metadata when the photo was taken, this will shift with +15hours + 30min


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: