Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Split command

Shulou Source: shulou.com Published: 2022-06-01 09:57:47 09月25日 Update

The split command can split a large file into many small files, and sometimes it is necessary to split the file into smaller fragments, such as generating logs for readability.

Option

-b: the value is the size of each output file, in byte.

-C: the maximum number of byte per line in each output file

-d: use numbers as suffixes.

-l: the number of columns with a value of each output file

Example: split a file in units of 10k

After splitting split-b 10k 2.txt, you will get a xaa file.

Example: split a file with 3 behavior units

Split-l 3 company.txt has 3 more files

There are 9 lines.

Xaa file

Xab file

The xac file is 3 blank lines

Example: split a file and customize its name

Split-b 1 company.txt test_

Tags: File unit output size command maximum readability name suffix number log file fragment blank line behavior generation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi macOS Apple Shulou Technology MySQL