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

Create a script of the last executed command
Sometimes commands are long, but useful, so it's helpful to be able to make them permanent without having to retype them. An alternative could use the history command, and a cut/sed line that works on your platform. $history -1 | cut -c 7- > foo.sh

Rename all files in lower case
rename is a really powerfull to, as its name suggests, rename files

calculate the total size of files in specified directory (in Megabytes)

Disable sending of start/stop characters
This command disable sending of start/stop characters. It's useful when you want to use incremental reverse history search forward shortcut (Ctrl+s). To enable again, type: $ stty -ixoff

Checks the syntax of all PHP files in and below the current working directory
Uses the PHP binary to check the syntax of all .php files in or below the current working directory. Really handy for doing that last minute check before you commit code to the repository.

aptitude easter eggs
this is a reference to Antoine de St. Exupery's "The Little Prince"

Use a var with more text only if it exists
See "Parameter Expansion" in the bash manpage. They refer to this as "Use Alternate Value", but we're including the var in the at alternative.

archlinux: shows list of files installed by a package
Shows the files which the package, for example gvim, installed on your system.

Extract android adb ab backup to tar format (only works for non encrypted backups)

Generate a random password 30 characters long
This command is similar to the alternate, except with head(1), you can pick as many passwords as you wish to generate by changing the number of lines you wish to preview.


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: