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

Extract raw URLs from a file
you can also use cut instead of awk. less powerful but probably faster. ;)

Get technical and tag information about a video or audio file
MediaInfo supplies technical and tag information about a video or audio file. (sudo apt install mediainfo)

Merge tarballs
Requires the GNU tar ignore zeros option. http://www.gnu.org/software/tar/manual/html_section/Blocking.html

Stream YouTube URL directly to mplayer.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

gvim in full screen (execute again to toggle full screen on/off)
Only under linux. Requires Gvim compiled with "clientserver" functionality and wmctrl command installed on system. Instead of servername can be used the current edited file name. Put it in a function and map it for get rid of "Press a key" after execution.

Display PHP files that directly instantiate a given class
This greps all PHP files for a given classname and displays both the file and the usage.

Convert ascii string to hex
If you're going to use od, here's how to suppress the labels at the beginning. Also, it doesn't output the \x, hence the sed command at the end. Remove it for space separated hex values instead

unrar all part1 files in a directory

dd with progress bar and statistics to gzipped image
This is a useful command to backup an sd card with relative total size for piping to pv with a progressbar


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: