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

rename anime fansubs
renames Anime Episodes to files, that can be parsed by sonarr & co

shell function to make gnu info act like man.
For those who hate navigating info pages, a shell function which will dump the contents to stdout, then page it through less, thus acting like 'man'.

Use the arguments used in the last command
Very basic, but who knows.. mkdir !$ should work too, only uses 'the last' argument. !-2 executes cd Desktop/Notes again. More tips in 'man history'

Sort specific lines while editing within vi
Sort lines within vi editor. In this example sort lines 33-61 and lines 4-9 asciibetically.

Find Duplicate Files (based on size first, then MD5 hash)
This dup finder saves time by comparing size first, then md5sum, it doesn't delete anything, just lists them.

a function to create a box of '=' characters around a given string.
First argument: string to put a box around. Second argument: character to use for box (default is '=') Same as command #4962, cleaned up, shortened, and more efficient. Now a ' * ' can be used as the box character, and the variables get unset so they don't mess with anything else you might have. They marked c++ as a function for this command, but I'm not sure why. Must be a bug.

pip install into current directory without virtualenv
For subsequent commands in the prefixed path: $ PYTHONPATH=$PWD/lib/python*/site-packages ./bin/pip --version

backup your history
simple and easy backup your history with timestamp

Get absolut path to your bash-script
Another way of doing it that's a bit clearer. I'm a fan of readable code.

Nicely display mem usage with ps
Nicely display mem usage with ps.


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: