Labels

hpunix (63) marathi kavita (52) linux (21) solaris11 (10) AWS (5) numerology (5)

Tuesday, May 11, 2021

How to split big files in Unix

 How to split big files in solaris:

Sometime the log files is too large to send backend team for further analysis, in that case we break the files into multiple pieces using split command.


Whenever we split a large file with split command then split output file’s default size is 1000 lines and its default prefix would be ‘x’.

Suppose we want to send crash dump (vdump) file which is 2GB of size. We will break that file into 4 pieces of size 500MB.


In that case:

#split -b 500M vdump.24 = This will break vdump.24 file into 4 pieces of name Xa , Xb, Xc, Xd


If we feel aa ab are little bit confusing file names then better to give specific name at the time of spliting the file itself.

#split -b 500M vdump.24 vdump_11May2021_X = It will create new files of name vdump_11May2021_Xa ,  vdump_11May2021_Xb


If we want to split file into GB then we may use command something like:

#split -b 1G vdump.24 vdump_11May2021_1

or

#split -b 1024M vdump.24 vdump_11May2021_1



Regards,

Kiran Jaddhav