The split CommandNow that you know how to find out how much data is in a file, and what that file is comprised of logically to build up its internal structure, we will look at how to take a large file and break it down. The split command will do just that. It will cut down a file into whatever length you specify. To use the split command you need only to know that a file is too large to work with or to send to someone. Once this is determined, you can execute the split command to break it down. To split the file, take the following steps:
An example of this functionality: >split -l 3 boot.msg splitfile The boot.msg file from the previous example has been run through split and has been divided into two files of three lines each. The l option specified the 3 lines each. It's important to know this command if you want to break data down into manageable chunks so that you can either work with them or send them to others. You may be wondering how you reassemble a file after you break and split it up. You can do this with a previously learned command, the cat command. You need to reassemble your files that you just split. To do this, you need to use the cat command. When you have a series of files named with something such as <name> (<name>aa, <basename>ab, <basename>ac<basename>zz), you can reassemble them by issuing the cat command as follows: cat <basename>* > combine_complete.file. This will reassemble your files so that you can work with them. Another handy set of utilities you will come to love is the patch and diff commands. These utilities will also help you with your Unix file management. |