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

Convert JSON to YAML
You need to install the Catmandu Perl module via `cpanm Catmandu`

Show only existing executable dirs in PATH using only builtin bash commands
Finds executable and existing directories in your path that can be useful if migrating a profile script to another system. This is faster and smaller than any other method due to using only bash builtin commands. See also: + http://www.commandlinefu.com/commands/view/743/list-all-execs-in-path-usefull-for-grepping-the-resulting-list + http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html

mplayer -vo aa foo.mpg
mplayer -vo caca will give you a similar result but in color

C one-liners
$ /lib/ld-linux.so.2 is the runtime linker/loader for ELF binaries on Linux. =(cmd) is a zsh trick to take the output for the command "inside" it and save it to a temporary file. $ echo -e 'blah' | gcc -x c -o /dev/stdout - pipes the C source to gcc. -x c tells gcc that it's compiling C (which is required if it's reading from a pipe). -o /dev/stdout - tells it to write the binary to standard output and read the source from standard input. because of the the =() thing, the compiled output is stashed in a tempfile, which the loader then runs and executes, and the shell tosses the tempfile away immediately after running it.

List hostnames of all IPs

Dump the root directory to an external hard drive
This will compress the root directory to an external hard drive and split it to parts once it reaches the 4 Gigs file system limit. You can simply restore it with: $ restore ivf /media/My\ Passport/Fedora10bckup/root_dump_fedora

Show an application's environment variables

Find Files That Exceed a Specified Size Limit

Resume a detached screen session, resizing to fit the current terminal
By default, screen tries to restore its old window sizes when attaching to resizable terminals. This command is the command-line equivalent to typing ^A F to fit an open screen session to the window.

Convert a date to timestamp
Simple way to get a timestamp from a date


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: