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

Shell function to exit script with error in exit status and print optional message to stderr
USAGE: die ERRNUM [MESSAGE]

Create a simple video contact sheet using the vcs bash script
Assumes you've downloaded Toni Corvera's vcs script (http://p.outlyer.net/vcs), have it in your PATH, and have installed the script's dependencies. Generates a video contact sheet of 24 thumbnails and 3 thumbnails per column. The bold font and white-on-black color scheme keeps the text readable at the chosen 70% JPEG compression quality, which keeps the file size at a manageable level. You can go even lower with the quality and get a good looking result.

Get IPv4 of eth0 for use with scripts
I've been using it in a script to build from scratch proxy servers.

Color STDERR in output
This command will take the output of a command and color any STDERR output as a different color (red outline in this case)

Create a listing of all possible permissions and their octal representation.

Show whats going on restoring files from a spectrum protect backup
spectrum protect's dsmc command shows file names and total amount of restore. This command shows which files are actually open and their siz in GB and highlights the change to the previous output

Rename files in batch

xargs for builtin bash commands
Similar to xargs -i, but works with builtin bash commands (rather than running "bash -c ..." through xargs)

Alternative size (human readable) of files and directories (biggest last)
using mb it's still readable;) a symbol variation $ du -ms {,.[^.]}* | sort -nk1

Ping a range of addresses


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: