Split and concatenate command used for files in Linux system

Split and Concatenate files Linux Command

How to Use the split Command to Split Text Files?

SPLIT Command
SPLIT command is used to split the large file into smaller file. It is very useful command if you want to place large file into small sizes and copy them parallel to other server then concatenate the file into one.

Syntax:

split -b Number [ k | m ]  [filename]

Example: Split the file into the 10gb size small size file.

split -b 10000m dumpfile.gz

It will give output as filename : xaa,xab,xac,xad,xae

What is the command to concatenate files in Linux?

Concatenate Command
Concatenate command is used for concatenate the split files by following Example:

Concatenate the file that is split

cat x* > dumpfile.gz

cat x.?? > dumpfile.gz

— We can use ?? also to define only extension of two character will combine the file.

Leave a Reply