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

Remove sound from video file using mencoder
Remove sound from input video file, output video stream is copied from input video stream, with no audio.

move contents of the current directory to the parent directory, then remove current directory.
I think this is less resource consuming than the previous examples

Download all music files off of a website using wget
This will download all files of the type specified after "-A" from a website. Here is a breakdown of the options: -r turns on recursion and downloads all links on page -l1 goes only one level of links into the page(this is really important when using -r) -H spans domains meaning it will download links to sites that don't have the same domain -nd means put all the downloads in the current directory instead of making all the directories in the path -A mp3 filters to only download links that are mp3s(this can be a comma separated list of different file formats to search for multiple types) -e robots=off just means to ignore the robots.txt file which stops programs like wget from crashing the site... sorry http://example/url lol..

Compare two directory trees.
This uses Bash's "process substitution" feature to compare (using diff) the output of two different process pipelines.

Get length of current playlist in xmms2

List bash functions defined in .bash_profile or .bashrc
If you issue the "set" command, you'll see a list of variables and functions. This command displays just those functions' names.

Geolocate a given IP address
Defines a function to geolocate a given IP address; if none supplied, will default to your external IP address.

Move mp3 files to another path with existing subtree structure
Use case: folder with flac files with tree structure ../artist/album/number-title.flac 1) convert flac->mp3 in the same folder: http://www.commandlinefu.com/commands/view/6341/convert-all-.flac-from-a-folder-subtree-in-192kb-mp3 2) search for mp3 files and recreate tree structure to another path: http://www.commandlinefu.com/commands/view/8853/copy-selected-folder-found-recursively-under-src-retaining-the-structure 3) move all mp3 files to that new folder: this command

Execute matlab sentences from command line
Execute matlab sentences in shell script: for var in `seq 0 0.2 1` ; do echo "my_function($var);" | matlab -nodisplay done

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"


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: