Hi everyone,
You need to separate them into small pieces to use them without any problem. It can be any type of file.
In this case, I will try to show you how to separate a large file into small pieces of the file in a Linux environment. Separating files in Linux OS is easy with the command line.
We can use split
the command in your system. In short, split
reads the given file and breaks it up into files. The default number of lines per file is 1000.
Assume that we have a file that is ~2MB.
split test-file.txt
This command will separate test-file.txt
into small files where the line number is limited to 1000.


If you would like to split the file you have with different line numbers, you can also use a -l
parameter like below.
The command below will create files with a maximum of 500 lines.
split -l 500 test-file.txt


On the other hand, you can also split your file with the size option. For this feature, you need to use -b
parameter while running the command. -b
means byte_count.
The following command splits the file into 500KB files.
split -b 500K test-file.txt

The split
command is a very useful command for splitting files into smaller pieces in Linux.
If you would like to know more about split, please use the man split
command in your terminal, or you can visit the Linux manual page.
I hope you enjoy reading.
Have a nice coding!