English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux split command

Linux Command大全

The Linux split command is used to split a file into several.

This command splits large files into smaller ones, by default, it will split according to every1000 lines cut into a small file.

Syntax

split [--help][--version][-<Line Number>][-b <Bytes>][-C <Bytes>][-l <Line Number>][File to Be Cut][Output Filename]

Parameter Description:

  • -<Line Number> : Specify how many lines to cut into a small file
  • -b<Bytes> : Specify how many bytes to cut into a small file
  • --help : Online Help
  • --version : Display version information
  • -C<Bytes> : With parameter-b"similar, but in cutting Cut while trying to maintain the integrity of each line
  • [Output Filename] : Set the prefix of the split files Split will automatically add numbers to the prefix of the filename

Online Examples

Use the command "split" to split the file "README" every6Line split into a file, input the following command:

$ split -6 README       #Split the README file into files of six lines each 

After executing the above commands, the command "split" will split the original large file "README" into multiple small files starting with "x". And in these small files, each file only has6Line content.

Use the command "ls" to view the current directory structure, as shown below:

$ ls                                #Execute ls command  
#Get Current Directory Structure  
README xaa xad xag xab xae xah xac xaf xai    

Linux Command大全