Pages

Friday, July 18, 2014

split one file to multiple files linux how to

split one file to multiple files linux how to

Say I have a file (XML File) of 4 GB. How shall I split it up into

2 X 2 GB (or)
4 X 1 GB ?

With split tool, a default linux utility, we can split a single file into multiple small files.

The following command will split up the file into 2 files of size 2 GB,


split -b 2048M -d Input_File.xml  file_

where,

-b   ------------> Size of small file
-d   ------------> Name of the File
file_------------> Starting word of file Name, which will be sequenced.

say, I have output files as, file_00, file_01 etc.


Reference:

http://stackoverflow.com/questions/19031144/how-to-split-one-text-file-into-multiple-txt-files

No comments:

Post a Comment