split command

This command can be used to split a large file into smaller sections. One of the most powerful and useful options is the '-b' option which allows binary (e.g. executable, movie, picture) files to be split up into smaller segments. These can then be transported using floppy disks to another location and then be brought together again into the original file using the tzsh specific '-b' option on the cat command.

For example, an animation file call 'myanim.avi' has a file size of 2061112 bytes, this is to big for transport by floppies so a split command is issued as follows.

split -b -1000000 myanim.avi mx

this will result in the following files being created:
mxaa size 1000192,
mxab size 1000192 and
mxac size 60728.

Using a bigger size on the split could have reduced the number of output files, the 1000000 figure was just an example). As you will see, split in this case has broken the file into 3 files, two approximately of the requested size (nearest block size) plus one for the remaining data. Using the following command the original file can be reconstructed exactly

cat -b mxaa mxab mxac > myanimagain.avi

You will also note that all the above processes are very fast. Actually the output filename is automatically created using the sequence <user_selected_name>aa, <user_selected_name>ab... <user_selected_name>ba... <user_selected_name>zz so a very large can be split up into quite small components (upto 26*26 = 676 components). To rejoin a large number of files a short cut can be used, assuming a creation/listing sequence based on name/date you may use for the above example cat -b mx* > myanim.avi where mx* is a wildcard file specification.