- Linux Training
- Desktop Tutorials
- Server Tutorials
|Linux Commands - Managing Files and Text|
If you needed to split a file into smaller sections to manipulate in a program you could use the split command.
-n line number the default number of lines is 1000
In this example the file data is split into sections having 5 lines each. Also notice that each new file has a prefix “datasplit_” added to the command to enable you to differentiate the new files.
split -5 data datasplit_
In the example you can see that the default is to start with a file name of aa and precede onward. Here is a look at the content of datasplit_aa
Just as expected each file contains five lines of text.