Linux split command
Linux split command
Linux split command is used to split a file into several.
The directive will split large files into smaller files by default will be cut into a small file as per 1000 lines.
grammar
split [--help][--version][-<行数>][-b <字节>][-C <字节>][-l <行数>][要切割的文件][输出文件名]
Parameter Description:
- - <Number of lines>: Specify how many rows into a small file every
- -b <bytes>: Specifies the number of bytes each into a small file
- --help: Online Help
- --version: display version information
- -C <Byte>: parameter "-b" is similar, but will try to maintain the integrity of each line when cutting
- [Output file name]: After setting the pre-cut name of a file, split automatically at pre-numbered file name and then add
Examples
Using the command "split" the file "README" every six lines cut a file, enter the following command:
$ split -6 README #将README文件每六行分割成一个文件
After the above command is executed, the instruction "split" will be the original large file "README" cut into a plurality of "x" at the beginning of small files. In these small files, each file has only 6 lines.
Use the command "ls" to see the current directory structure, as follows:
$ ls #执行ls指令 #获得当前目录结构 README xaa xad xag xab xae xah xac xaf xai