How do I use Split in the Mac OS X Terminal to split files directly to another directory?

18

2

How do I use the OS X Terminal command split to split a file into several pieces, and store them in a different folder, on a different drive?

The reason is that I need to move files to a FAT32 store, but they are too large for the FAT32 4 GB file size constraint.

Also, I don't have enough space left on my HFS+ drive to split it there, and then move it.

Any ideas?

Kebman

Posted 2011-07-20T22:36:15.893

Reputation: 467

Answers

21

If Mac OS X's split acts just like the GNU Coreutils split, cd to the directory you wish the split files to reside in and then run the following command:

split -b <size> /location/of/big/file

Lamar B

Posted 2011-07-20T22:36:15.893

Reputation: 1 265

2The obvious next question would be how to join the files back together again. The join command isn’t suitable. The cat command can be used instead: cat file1 file2 file 3 > onebigfile or cat file* > onebigfile – user535673 – 2015-01-16T13:10:21.450

BIG THANKS! :D Seems to work, as I'm currently "split-copying" now. Here's what I did: CD'd to the directory I wanted the files in, just as you told, and then I typed: split -b 2048m /location/of/big/file But I chose some other directories, though LOL – Kebman – 2011-07-20T22:57:47.013