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

Show sections of a man page.
Uses the formatting of a man page to show an outline of its headers and sub-headers.

Using parcellite, indents the content of the clipboard manager
This command takes the content of a Parcellite-managed clipboard manager and add one level of indentation to it. It may be useful to indent a block of code which will enter inside another, already indented one but I use it mostly to indent code I will post in Stack Overflow questions and answers.

Pulse Volume Control Using Zenity
This produces a little bar that you can use to set the volume percentage.

Delete all files in a folder that don't match a certain file extension
Deletes all files in a folder that are NOT *.foo, *.bar or *.baz files. Edit the pattern inside the brackets as you like.

Find files with the same names in several directories.
cat file1 file2 file3|sort|uniq -d finds the same lines in several files, especially in files with lists of files.

Use top to monitor only all processes with the same name fragment 'foo'
Like command 10870, but no need for sed

Convert a script to one-liner
Opposite: Convert an one-liner to script: $ foo() { ; } ... $ typeset -f foo ... $ unset -f foo

Automaticly cd into directory
Makes bash-4.x like zsh. Automatic cd into a directory if a command with that name doesnt exists. Ready for your ~/.bashrc file

GZip all files in a directory separately

Split huge file into DVD+R size chunks for burning
Real DVD+R size is 4700372992 bytes, but I round down a little to be safe. To reconstitute use cat. "cat file.img.gz.aa file.img.gz.ab ..... > file.img.gz"


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: