Split a file in pieces with “split” and put it back together again with “cat”

split

This is a simple solution If you have a large file and need to cut it up in small peaces for whatever reason. this is handy if your cloud storage provider doesn’t let you upload large files or if you plan on saving your digital movie collection on thousands of floppy disks..
And did I mention it’s super easy to do? You can do this without anything except the good ol´ command line and it only takes a moment, so here it is.

1. Open your terminal (assuming you use either linux or OSX) and cd to the directory you have stored your file.

2. Decide the size of the pieces you want of the pieces. I have chosen 200mb for my demonstration.

3. Split the file using the “split” command
In this example the file is called bigfile.iso

split -b 200m bigfile.iso bigfile.iso.

 

Notice the period after the last bigfile.iso. This is just to make it easy to distinguish the files later, especially if you have a very big file.

split

4. That’s it. The file will now be split in 200mb -pieces with filenames in alphabetical order like bigfile.iso.aa, bigfile.iso.ab etc. (The full size file is still there unless you manually delete it, you just made a copy in small pieces)

5. Put it back together again using the “cat” command

cat bigfile.iso.* > bigfile.iso

 

cat - combine files

Voila!

Be the first to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.