Split the File based on Size

I have a file that is about 7 GB in size. The requirement is I should split the file equally in such a way that the size of the split files is less than 2Gb. If the file is less than 2gb, than nothing needs to be done. ( need to done using shell script)

Thanks,

Hi,
What is the file type ?

Regards.

If lines of text, practically the essence of 'split': split(1) [linux man page]

its a .txt file.

I am familiar to splitting the file, not sure how to drive the logic with size.

example.

split -l 4000 <file_nm> <file_nm-a>

If you look at the link DGPickett provided you will see the -b option splits file by size in bytes. Here is one way:

if [ `ls -l <file_nm>  | awk '{print $5}'` -gt 2000000000 ]; then split -b 2000000000 <file_nm> <file_nm-a>; fi