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

Rename files in batch

List all symbolic links in current directory
why go through the hard way? use find with -type l

Copy specific files recursively using the same tree organization.
This command has been used to overwrite corrupted "entries" files of a corrupted subversion working copy. Note the --files-from input format.

Quickly Encrypt a file with gnupg and email it with mailx
This is a quick and easy way of encrypting files in a datastream, without ever really creating an output file from gpg. Useful with cron also, when file(s) have to be sent based on a set schedule.

Make anything more awesome
Pipe any command through figlet to make the output more awesome. Example: $ ls | figlet

HTTP redirect
any HTTP requests to the machine on the specified port will be redirected to http://www.whatevs.com... quick, dirty, works fine for sites w/

Backup with versioning
Apart from an exact copy of your recent contents, also keep all earlier versions of files and folders that were modified or deleted. Inspired by EVACopy http://evacopy.sourceforge.net

bash: hotkey to put current commandline to text-editor
* in bash-shell You can capture the current commandline to a text-editor: * simply press: CTRL+x+e * Your current commandline will pe put into Your default text-editor (export EDITOR=vim)

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"

Setting global redirection of STDERR to STDOUT in a script
You have a script where =ALL= STDERR should be redirected to STDIN and you don't want to add "2>&1" at the end of each command... E.G.: $ ls -al /foo/bar 2>&1 Than just add this piece of code at the beginning of your script! I hope this can help someone. :)


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: