What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.

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:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags



Psst. Open beta.

Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:

  • » The open beta is running a copy of the database that will not carry over to the final version. Don't post anything you don't mind losing.
  • » If you wish to use your user account, you will probably need to reset your password.
Your feedback is appreciated via the form on the beta page. Thanks! -Jon & CLFU Team

Commands tagged video from sorted by
Terminal - Commands tagged video - 68 results
mencoder -of avi -ovc lavc movie.avi -o movie2.avi; ffmpeg -i movie2.avi -r 12 -b 100 movie.flv
2009-08-28 11:05:21
User: dcabanis

First, we convert the VMware avi (VMnc format) to the Microsoft avi format. Next, we convert the Microsoft avi format to FLV format.

You can play around with the -r switch (rate per second) and the -b switch (bitrate). But, if those get larger, so does your FLV file.

ffmpeg -an -f video4linux -s 320x240 -b 800k -r 15 -i /dev/v4l/video0 -vcodec mpeg4 myvideo.avi
2009-06-19 17:41:43
User: dcabanis

The option -an disables audio recording, -f forces the use of video4linux for the input, -s sets the video to the size 320x240, -b sets the recording bitrate, -r sets the frame rate to 15fps, -i gives the input device, -vcodec sets the output format.

Press Q to stop recording or you can specify the recording time with the -t option like -t 00:1:30

mencoder video.avi lavc -lavcopts vcodec=mpeg4:vbitrate=800 newvideo.avi
2009-06-19 17:30:46
User: dcabanis

Encode video.avi into newvideo.avi using the libav codec to produce an MPEG4 file with a bitrate of 800

mencoder -tv device=/dev/video1 tv:// -ovc copy -o video.avi
2009-06-19 17:21:33
User: dcabanis

video.avi is the resulting file. Press Ctrl+c to stop the recording. You can change the OVC option to another to record into a different format.

ffmpeg -f x11grab -r 25 -s 800x600 -i :0.0 /tmp/outputFile.mpg
2009-06-05 21:11:17
User: dcabanis
Tags: video X11 ffmpeg

Grab X11 input and create an MPEG at 25 fps with the resolution 800x600

ffmpeg -i source_movie.flv -vcodec mpeg2video target_video.m2v -acodec copy target_audio.mp3
2009-05-23 23:52:51
User: dcabanis

rips the audio and video stream of a movie. The two streams are stored separately.

ffmpeg -i source_audio.mp3 -itsoffset 00:00:10.2 -i source_video.m2v target_video.flv
2009-05-23 23:47:41
User: dcabanis

This assumes that there is a 10.2 sec delay between the video and the audio (delayed).

To extract the original video into a audio and video composites look at the command on extracting audio and video from a movie

ffmpeg -i mymovie.mpg -ar 22050 -acodec libmp3lame -ab 32K -r 25 -s 320x240 -vcodec flv mytarget.flv
2009-05-23 23:39:46
User: dcabanis

Takes an mpeg video and coverts it to a youtube compatible flv file.

The -r 25 sets the frame rate for PAL, for NTSC use 29.97

ffmpeg -i source.flv -vn acodec copy destination.mp3
2009-05-23 23:34:32
User: dcabanis

-vn removes tha video content, the copy option tells ffmpeg to use the same codec for generating the output

lspci |grep VGA
2009-04-28 08:34:42
User: CafeNinja
Functions: grep lspci
Tags: video Ubuntu

Displays only the VGA adapter/chipset being used for the graphics. In this case, it gave me the "M22" and "Mobility Radeon x300" that I needed to research a graphics issue I was having.

mplayer -framedrop -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all
2009-04-27 15:40:55
User: baergaj
Tags: video mplayer

Certain codecs in high res don't play so well on my Dell Mini 9. Using this command, I can play just about anything and it keeps the sound in sync to boot!

ffmpeg -i file.flv -r 15 -b 128k -s qcif -acodec amr_nb -ar 8000 -ac 1 -ab 13 -f 3gp -y out.3gp
2009-03-23 14:30:45
User: jjclarkson
Tags: video ffmpeg

Download YouTube videos as .flv and convert them to .3gp for your mobile phone.

mencoder -ovc copy -oac copy -of avi -o remuxed.avi original.avi
2009-03-23 10:15:36
User: iain

When playback of AVI files (containing a video format like XviD or DivX) is stuttering, it in 90% of the files is caused by a poorly or wrongly interleaved file. The issue can be permanently resolved by RE-MUXING the AVI video-files that have this problem

ffmpeg -vcodec copy -acodec copy -i orginalfile -ss 00:01:30 -t 0:0:20 newfile
2009-03-16 12:58:07
User: ako


-vcodec, you choose what video codec the new file should be encoded with. Run ffmpeg -formats E to list all available video and audio encoders and file formats.

copy, you choose the video encoder that just copies the file.

-acodec, you choose what audio codec the new file should be encoded with.

copy, you choose the audio encoder that just copies the file.

-i originalfile, you provide the filename of the original file to ffmpeg

-ss 00:01:30, you choose the starting time on the original file in this case 1 min and 30 seconds into the film

-t 0:0:20, you choose the length of the new film

newfile, you choose the name of the file created.

Here is more information of how to use ffmpeg:


mencoder -vf rotate=1 -ovc lavc -oac copy "$1" -o "$1"-rot.avi
mencoder "$1" -ofps 23.976 -ovc lavc -oac copy -o "$1".avi
mplayer -dumpstream -dumpfile "yourfile" -playlist "URL"
2009-02-28 22:18:17
User: Alanceil

I use this command to save RTSP video streams over night from one of our national TV stations, so I won't have to squeeze the data through my slow internet connection when I want to watch it the next day.

For ease of use, you might want to put this in a file:


FILE="`basename \"$1\"`"

mplayer -dumpstream -dumpfile "$FILE" -playlist "$1"

function encode4phone() { ffmpeg -acodec libamr_nb -vcodec h263 -i "$1" -s qcif -b 200k -ac 1 -ab 7.4k -ar 8000 "$1.3gp" }