• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar

The Geek Diary

HowTos | Basics | Concepts

  • Solaris
    • Solaris 11
    • SVM
    • ZFS
    • Zones
    • LDOMs
    • Hardware
  • Linux
    • CentOS/RHEL 7
    • RHCSA notes
    • SuSE Linux Enterprise
    • Linux Services
  • VCS
    • VxVM
  • Interview Questions
  • oracle
    • ASM
    • mysql
    • RAC
    • oracle 12c
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Hadoop
    • Hortonworks HDP
      • HDPCA
    • Cloudera
      • CCA 131

How to split iso or file using ‘split’ command in Linux

By admin

You may need to cut down or split a file into smaller pieces sometimes. This is very useful when you want to cut down a large iso to fit into a DVD or CD. or can also be used to transfer over a network. To split the file into smaller pieces, we can use the split command.

The syntax for the split command is :

# split -b [size of split pieces] [file to split] [split file prefix]

For example to split an iso file image.iso of size 4.6GB into smaller chunks of 2000MB use the below command:

# split -b 1200M image.iso split-file

SIZE of the smaller files to be created may be one of the following, or an integer optionally followed by one of following multipliers:

suffix multiplier
KB 1000
K 1024
MB 1000 x 1000
M 1024 x 1024

This will generate 3 files with the following file sizes. You can specify the file prefix for the smaller files.

# du -sh chunks-a*
2.0G	chunks-aa
2.0G	chunks-ab
0.6G	chunks-ac

To recreate the file, use the cat command.

# cat split-imga* > new-image.iso

The split and cat commands are provided by the coreutils package.

Verify the integrity of the file

Note: To verify that the file has been correctly restored, use the command md5sum before and after splitting the file. Syntax:

# md5sum [filename]

Before spliting

# md5sum image.iso
06caba513738f3af0ac475910e7f8a0f  image.iso

After recreating the file from split pieces

# md5sum new-image.iso
06caba513738f3af0ac475910e7f8a0f  new-image.iso

Filed Under: Linux

Some more articles you might also be interested in …

  1. Linux OS Service ‘ntpd’
  2. Linux OS Service ‘rpcidmapd’
  3. CentOS / RHEL 4 : How to install and configure FTP server (vsftpd)
  4. CentOS / RHEL 7 : How to create custom script to run automatically during boot
  5. How to Run DNS and FTP services in a chroot Jail
  6. How to Reserve a Port Range for a Third Party Application in CentOS/RHEL
  7. CentOS / RHEL : How to find UUID of a device or filesystem
  8. Linux OS Service ‘rpcgssd’
  9. Understanding shell profiles in CentOS/RHEL
  10. How to add or delete a samba user under Linux

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable firewalld and nftables and use iptables instead in CentOS/RHEL 8
  • How to add an Ethernet connection using nmcli in CentOS/RHEL 7
  • How to set the order to load certain modules in CentOS/RHEL 7 and 8
  • How to configure initrd / initramfs to including kernel modules in CentOS/RHEL
  • How to configure systemd.path to trigger an event when any changes made to a directory
  • Archives
  • Contact Us
  • Copyright

© 2019 · The Geek Diary