Description: In general, split cuts by number of rows are mostly used on log files.
Instance:
Divide a large file into several small file methods:
For example, a BLM.txt file is divided into 1000 small files prefixed with blm_, with a suffix of factor form and a suffix of 4 digits
1, first Use
Wc
read out how many lines of BLM.txt file there are
Re-use the split command
Split 2482 4 Blm_
BLM.txt the file into several small files, 2482 lines per file (-l 2482), file prefix is blm_, the coefficient is not a letter but a number (-D), the suffix factor is four digits (-a 4)
Unfortunately, the file can not be a suffix can not be blm_*.text to achieve, the result can only be blm_0000. However, it can be processed on its own, such as batch renaming:
' s/$//.txt/ '
Use Rename to rename any file in the current directory to a. txt extension.
In addition to cutting files, there are also merge files, using the cat command:
Cat Blm_* >blm.txt
You are using the Cat command.
Reference:
http://blog.csdn.net/jkunzhang/article/details/7666398
https://www.cnblogs.com/AloneSword/p/5072698.html (Rename usage)
Http://man.linuxde.net/split (split usage)
Http://man.linuxde.net/cat (cat usage)
Use split to cut by number of lines under Linux