Easy Tutorial
❮ Linux Comm Mdel Linux Comm Join ❯

Linux split Command

Linux Command Manual

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

This command splits large files into smaller ones, with each file containing 1000 lines by default.

Syntax

split [--help][--version][-<lines>][-b <bytes>][-C <bytes>][-l <lines>][file to be split][output file name]

Parameter Description:

Example

To split the file "README" into files with 6 lines each using the "split" command, enter the following command:

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

After executing the above command, the "split" command will split the original large file "README" into multiple small files prefixed with "x". Each of these small files will contain only 6 lines.

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

$ ls                                # Execute ls command  
# Get the current directory structure  
README xaa xad xag xab xae xah xac xaf xai

Linux Command Manual

❮ Linux Comm Mdel Linux Comm Join ❯