CD/DVD Burning, Mounting and Ripping from a Terminal in Linux

CD/DVD Burning, Mounting and Ripping from a Terminal in Linux

There are quite a few strong GUI tools for working with media in Linux. However, working from a terminal can frequently be more efficient and this post outlines some of the commands you can use to do this.

Download a CD/DVD image:

# wget http://www.example.com/linux/ubuntu/image.iso

Get an md5 hash of a file:

# md5sum image.iso

Create an iso from an unmounted CD/DVD in your CD/DVD drive:

# dd if=/dev/cdrom of=/tmp/image.iso

Burn an iso you’ve ripped or downloaded:

# wodim -v dev=/dev/cdrw image.iso

Mount an iso to a folder:

# mount -o loop image.iso /mnt/folder_that_exists

Rip a CD and encode it as mp3 files:

# abcde -o mp3

Convert all the mp3 files in the folder into wav files

# for i in *.mp3; do mpg123 -w `basename $i .mp3`.wav $i; done

Burn all the wav files in the folder to an audio CD:

wodim dev=/dev/cdrw -eject speed=48 -pad -audio *.wav

Rip and encode a dvd to mp4:

# handbrake -i /dev/dvd -o video.mp4

Further reading:

http://www.andrews-corner.org/abcde.html
http://www.faqs.org/docs/Linux-mini/MP3-CD-Burning.html
http://handbrake.fr/
http://trac.handbrake.fr/wiki/CLIGuide