How to use split Linux command to split a file into pieces
Have you ever wanted to split a large file into multiple smaller files? For example, a 10Gb log file, we need to divide it into multiple small files, so that we can read it using a normal text editor. Sometimes we need to transfer a large file of 20Gb to another server, which requires us to split it into multiple files to facilitate data transfer. Let us how to use split Linux command to split a file into pieces.
Use
Example
2. Split 20Mb per file
split -b 20M dpkg.log
3. Split 50MB per file with a specified prefix for each file
split –bytes=50M dpkg.log dpkg_attack
4. Split file based on number of lines