Splitting a File into Multiple Smaller Files

Sometimes it is useful to be able to split a file into smaller files. If a file will not fit on a disk, for example, you could split the file into smaller files that would each fit on a disk. As another example, when using cu to dial into another UNIX system, you can put and take text files between systems. Because there is no error checking, noisy phone lines can result in the destination file being corrupted. In this situation, I have had good success by splitting the file into several smaller files and then transmitting them separately. Using the cat command, it is simple to reconstitute the original file by concatenating the smaller files.

Splitting a File into Equal-Length Pieces

To split one ...

Get Practical UNIX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.