Tuesday, 24 July 2012

Dealing with filenames that have spaces in them

If you're like me and every now and then are forced to do something on the command line, you may come across a situation where you need to do something to a file that has a space in it.  This is problematic on the command line as spaces indicate separation between different commands.

I came across this tonight when trying to transcode an mp4 file to an avi file so I could watch it on my hopeless Panasonic LCD which apparently only understands one video format.  Use single quotes around the filename and extension.

mencoder 'Jubbly Bits.mp4' -oac pcm -ovc copy -o 'Jubbly Bits.avi'