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

Print a horizontal line

move you up one directory quickly
In bash, this turns on auto cd. If a command is just a directory name, it cd's into that directory.

cat a bunch of small files with file indication
If you have a bunch of small files that you want to cat to read, you can cat each alone (boring); do a cat *, and you won't see what line is for what file, or do a grep . *. "." will match any string and grep in multifile mode will place a $filename: before each matched line. It works recursively too!!

Create a video screencast (capture screen) of screen portion, with audio (the audio you hear, not your mic)
Errors in output don't matter. Stop recording: ctrl-c. Result playable with Flash too. IMPORTANT: Find a Pulse Audio device to capture from: pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2

Find biggest 10 files in current and subdirectories and sort by file size

translates acronyms for you
very handy if you are in irc and absolutely don't know what these guys are talking about. this is a netbsd command, if you are lucky it exists in your distro's package database.

Parse YouTube url (get youtube video id)
url can be like any one of followings: $url="MejbOFk7H6c" $url="http://youtu.be/MejbOFk7H6c" $url="https://youtube.com/watch?feature=player_embedded&v=MejbOFk7H6c#t" $url="//www.youtube.com/v/MejbOFk7H6c?hl=ru_RU&version=3&rel=0" $url="http://www.youtube.com/embed/MejbOFk7H6c?feature=player_embedded" If url mismatching, whole url will be returned.

Search for a string inside all files in the current directory
Searches all files,dirs (also hidden) recursively

Find the package that installed a command

capture mysql queries sent to server


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: