Thursday, December 30, 2010

Extracting ISO in Linux via Command Line


By using simple command line options, reliably extract any ISO in Ubuntu.


Apparently, many tools are out of date for extracting ISO images via CLI. The linux kernel is very up to date and is the most reliable for accessing ISO files. Unfortunately, there is no one command to use it.

My Aliases

I'm no scripting genius, so I just used a few aliases to make it pretty easy.

First, make the directories that you plan to use for your ISO mounts.
mkdir iso1 iso2 iso3

Then create aliases in your .bashrc
pico .bashrc

Now add the aliases to mount and unmount the ISOs.
alias mountiso='sudo mount -o loop ./*.iso ~/iso1'
alias mountiso2='sudo mount -o loop ./*.iso ~/iso2'
alias mountiso3='sudo mount -o loop ./*.iso ~/iso3'
alias unmountiso='sudo umount ~/iso1'
alias unmountiso2='sudo umount ~/iso2'
alias unmountiso3='sudo umount ~/iso3'

To use them, cd to the dir with your ISO in it, and run one of the 3 commands.
cd ~/Downloads/CoolLinux

Copy your files. I like rsync's nice progress meter.
rsync --progress ~/iso2/BiggunTutorial.mp4 ./

Repeat for other ISOs if needed.