How to split a big file in smaller parts

How to split a big file in smaller parts

Sometimes could happen that you need to upload a very big file and your ftp connection doesn’t work so well, so you are still wasting time uploading half or maybe 3/4 of the file on your server leaving it corrupted and unfinished.

Well, if you own a Mac you are full of luck, because of the strong UNIX core of this great OS.
Using the Terminal we have two fantastic commands that can help us doing our dirty job.

Split and Cat

The first one is made to split the big file in smaller parts, where you can decide how big these parts have to be.
The second one at the end, help us to rebuild the big file starting from the smaller ones.

These are examples of how to use them:

$ split –b 100m /path/to/large/file /path/to/output/file/prefix

where after “-b” you can specify the size of the parts, you can also use m as megabytes, k as kilobytes and b as bytes

$ cat prefix* > NEWFILENAME

this is really simple to understand, basically it rebuild the big file combining the smaller

I hope this would help you.
Byez

Leave a Reply

*