Split Files Into Smaller Files
Sometimes a file is just a little too big for the media you want to store it on or the pipe you want to squeeze it though. The split command is here to help. It’s fast, it’s easy - and it’s already on your Mac.
In the screencast Murphy splits a thirty-something megabyte video into 9mb chunks - so he can back them up on his gmail account. (I’m expecting a lot of “Wouldn’t it be easier to…” on this one.) Keep in mind this is not a video splitter. The pieces aren’t viewable until you reassemble them. But you can use split on all kinds of files, even your zip archives.
We’ll be using the cat command for reconstituting our original file. We’ve seen plenty of cat in previous screencasts, but we’ve never used it quite like this.
Also in the screencast: Murphy demonstrates that Folder Actions work in a Terminal session. He’ll copy the pieces from a split file to an action-enabled folder - and the pieces will be automatically mailed to his Gmail account! This post is action-packed.
Maybe you want to break up some super-jumbo files for dvd storage. Take a look at this if you’re planning on creating chunks over 2gb.
The syntax Murphy uses in the screencast for reassembly is the most straight-forward he saw anywhere on the web. If you look around a little you can probably find scripts that do the same thing. Or check out Murphy’s post on making a shell script, maybe you can make your own.
3. May 2007 at 12:53 pm :
Invite sent..
3. May 2007 at 2:02 pm :
Thanks Niels - I got it. Much appreciated.
Anything good to watch on there??
3. May 2007 at 10:18 pm :
Wow! Another great post. I didn’t even know you could do this along with the folder actions. Well done. Thank you.
3. May 2007 at 11:55 pm :
Being able to take advantage of folder actions from the Terminal opens up lots of possibilities.
A while back people asked me why I use folder actions for certain things instead of droplets. Droplets are great too - but this is a great reason to use folder actions.
And split is a great feature. Easy to use, isn’t it?
Thanks for keeping up with the site!
-Murph
4. May 2007 at 3:20 am :
The 5th gear stuff is fun, and at times, I like Stella on Comedy Central