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

generate random password (works on Mac OS X)
Prepending env LC_CTYPE=C fixes a problem with bad bytes in /dev/urandom on Mac OS X

Ext3 format Terabytes in Seconds

Recursively chmod all dirs to 755 and all files to 644

Create backup copy of file, adding suffix of the date of the file modification (NOT today's date)
If your `date` command has `-r` option, you don't need `stat`

Testing hard disk reading speed

remove the last of all html files in a directory
sed can be used deleting the last line and with -i option, there's no need to for temp files, the change is made on the actual file

Search commandlinefu.com from the command line using the API
Usage: cmdfu hello world

Find and copy files from subdirectories to the current directory

Change prompt to MS-DOS one (joke)

Create a directory and change into it at the same time
How often do you make a directory (or series of directories) and then change into it to do whatever? 99% of the time that is what I do. This BASH function 'md' will make the directory path then immediately change to the new directory. By using the 'mkdir -p' switch, the intermediate directories are created as well if they do not exist.


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: