3 Ways to Extract and Copy Files from ISO Image in Linux

Let’s say you have a large ISO file on your Linux server and you wanted to access, extract or copy one single file from it. How do you do it? Well in Linux there are couple ways do it.

Read Also: A Bash Script to Create a Bootable USB from ISO in Linux

For example, you can use standard mount command to mount an ISO image in read-only mode using the loop device and then copy the files to another directory.

Mount or Extract ISO File in Linux

To do so, you must have an ISO file (I used ubuntu-16.10-server-amd64.iso ISO image) and mount point directory to mount or extract ISO files.

First create an mount point directory, where you will going to mount the image as shown:

$ sudo mkdir /mnt/iso

Once directory has been created, you can easily mount ubuntu-16.10-server-amd64.iso file and verify its content by running following command.

$ sudo mount -o loop ubuntu-16.10-server-amd64.iso /mnt/iso
$ ls /mnt/iso/
Mount ISO File in Linux
Mount ISO File in Linux

Now you can go inside the mounted directory (/mnt/iso) and access the files or copy the files to /tmp directory using cp command.

$ cd /mnt/iso
$ sudo cp md5sum.txt /tmp/
$ sudo cp -r ubuntu /tmp/
Copy Files From ISO File in Linux
Copy Files From ISO File in Linux

Note: The -r option used to copy directories recursively, if you want you can also monitor progress of copy command.

Extract ISO Content Using 7zip Command

If you don’t want to mount ISO file, you can simply install 7zip, is an open source archive program used to pack or unpack different number of formats including TAR, XZ, GZIP, ZIP, BZIP2, etc..

$ sudo apt-get install p7zip-full p7zip-rar [On Debian/Ubuntu systems]
$ sudo yum install p7zip p7zip-plugins      [On CentOS/RHEL systems]

Once 7zip program has been installed, you can use 7z command to extract ISO file contents.

$ 7z x ubuntu-16.10-server-amd64.iso
7zip - Extract ISO File Content in Linux
7zip – Extract ISO File Content in Linux

Note: As compared to Linux mount command, 7zip seems much faster and smart enough to pack or unpack any archive formats.

Extract ISO Content Using isoinfo Command

The isoinfo command is used for directory listings of iso9660 images, but you can also use this program to extract files.

As I said isoinfo program perform directory listing, so first list the content of ISO file.

$ isoinfo -i ubuntu-16.10-server-amd64.iso -l
List ISO Content in Linux
List ISO Content in Linux

Now you can extract a single file from an ISO image like so:

$ isoinfo -i ubuntu-16.10-server-amd64.iso -x MD5SUM.TXT > MD5SUM.TXT

Note: The redirection is needed as -x option extracts to stdout.

Extract Single File from ISO in Linux
Extract Single File from ISO in Linux

Well, there are many ways to do, if you know any useful command or program to extract or copy files from ISO file do share us via comment section.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

13 Comments

Leave a Reply
  1. I had problems to extract files with isoinfo.

    Solution:

    # isoinfo -i myiso.iso -R -x /SOME_FILE_IN_ROOT_OF_ISO
    

    Important was -R and the leading / for the path.

    Reply
    • The creator of this help file had a similar problem. See in the sample, the size of MD5SUM.TXT is 168387 in the iso an 0 in the unpacked form. Using Rockridge or Joliet extensions both seem to work (if they are included in the iso)

      Reply
      • Use mc (Midnight Commander) to browse and extract files from many archive formats, including iso, tar, gz, tgz, rpm, zip, and others.

        Reply
        • Thank you very much but, somehow I can only see the dmg file info plus 4 dirs, their sizes, and no other filei info. It is not showing the file names etc.

          Reply
  2. Best of all is probably BSD’s tar [uses libarchive]

    $ sudo apt install bsdtar
    $ bsdtar -xf youriso.iso -C targetfolder/
    

    For example, extracting an Ubuntu ISO, 7x extracts a [BOOT] folder, but omits the ubuntu -> ./ link
    bsdtar ok with link but no [BOOT] folder.

    neither seem to inherit permissions properly especially when using sticky bit.

    Reply
  3. @Bill: If you have a linux server you usually have no Window Manager installed. Ergo: Everything goes through commands. That’s why you have to do this “complicated” way.

    Reply
  4. Whats wrong with “Gnome Archive Manager” – I’m using Mint 18 – or one of the equivalents for other distros. Works very well and a lot less complicated than any of the above. I haven’t tried it but presume one could add files as well. Will give that a go some time and let you know.

    Reply
  5. Thank you for your article about managing and extractions iso files. However, most of the time that we have to deal with iso files, is to write them to a CD/DVD or to a pen drive, in order to use them to perform a subsequent software installation.

    It would be interesting to know similar Linux alternatives to the commonly used windows ImgBurn software.
    Regards.

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.