How to split large files on Linux


pizza

Have you ever needed to split a file into several parts? Today I made a VirtualBox Appliance which sizes 2.8 GB but I  have a 2 GB (1.8 Gb) pendrive. So, what can I do?…piece of cake, to use split and cat commands:

Split

Let’s say you want to split the file Draco.vdmk (a VirtualBox disk) into 1.5 Gb smaller parts, then just type:

split -b 1500m Draco.vmdk

Cat

In order to put thing together just use:

cat x* > Draco.vmdk

References

Artículos relacionados:

  1. ps3plit: script for spliting files bigger than 4GB
  2. Montando sistemas de archivos en Linux
  3. Enabling USB support for VirtualBox on Linux
  4. Reversing order of PDF files
  5. Running Windows apps on Linux

  1. avatar

    #1 by Luis Gallardo on 08/06/2010 - 1:38 pm

    @Skip Yes, the split command creates output files with this format xaa, xab, xac, etc. But you can change the prefix. For instance,

    split -d -b 500KB BASE.PBP part

    The above command makes the following files:

    -rw-r–r– 1 lgallard lgallard 500000 Jun 8 13:34 part00
    -rw-r–r– 1 lgallard lgallard 500000 Jun 8 13:34 part01
    -rw-r–r– 1 lgallard lgallard 392801 Jun 8 13:34 part02

    Cheers!!

  2. avatar

    #2 by Skip on 07/06/2010 - 11:43 pm

    Nice, this is what I was looking to find out… I would like to see some output though… For instance, since I first saw some stuff on using the split command, they mentioned the way it names the output files, per your example, I’m guessing x?????

    Anyways, thanks for letting me know it works with virtual disks!

Comments are closed.