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

Sed can refference parts of the pattern in the replacement:

Execute a command without saving it in the history
Prepending one or more spaces to your command won't be saved in history. Useful for pr0n or passwords on the commandline. Tested on BASH.

resolve hostname to IP our vice versa with less output
inverted version: resolveip -s 216.34.181.xxx freshmeat.net

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

Keep from having to adjust your volume constantly
Run this in the directory you store your music in. mp3gain and vorbisgain applies the ReplayGain normalization routine to mp3 and ogg files (respectively) in a reversible way. ReplayGain uses psychoacoustic analysis to make all files sound about the same loudness, so you don't get knocked out of your chair by loud songs after cranking up the volume on quieter ones.

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

Save your terminal commands in bash history in real time
Use this command if you want your terminal commands be saved in your history file in real time instead of waiting until the terminal is closed

Make vim open in tabs by default (save to .profile)
I always add this to my .profile rc so I can do things like: "vim *.c" and the files are opened in tabs.

Search commandlinefu.com from the command line using the API
for me the above command didn't work for more than one argument but this one does

Getting a domain from url, ex: very nice to get url from squid access.log


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: