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

another tweet function
This version of tweet() doesn't require you to put quotes around the body of your tweet... it also prompts you for password. It will still barf on a '!' character.

raw MySQL output to use in pipes
-N removes header -s removes separator chars -r raw output After using these options, the MySQL ouptut can be used with pipes very easily

Fake system time before running a command
Fake system time before running any command.

Clean up poorly named TV shows.
Replace 'SHOWNAME' with the name of the TV show. Add -n to test the command without renaming files. Check the 'sample output'.

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

list files recursively by size

find filenames and directory names that doesn't conform ISO 9660 level 2
You might want to check what file and directory names would be renamed or chopped if you create iso 9660 level 2 image out of them. Use this command to check first.

Delete Empty Directories
Deletes empty directories and prints an error if directory is not empty.

If (and only if) the variable is not set, prompt users and give them a default option already filled in.
The read command reads input and puts it into a variable. With -i you set an initial value. In this case I used a known environment variable.

list files recursively by size


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: