Operating System - HP-UX
1833271 Members
3203 Online
110051 Solutions
New Discussion

Using split command to transfer files

 
Peter Remirez
Occasional Advisor

Using split command to transfer files

Hi,
I have a file(not a filesystem) which is about 3GB in size. I would like to transfer this huge file over the WAN.

However, when I tried using rsync as tool to transfer this file over the WAN, it just hangs indefinitely.

Hence I tried breaking up the file into smaller equal sized chunks using:
# split -b 100000K bigFile.tar.gz

Once using split on the file above, I obtain the files with names beginning with xa i.e.
xaa
xab
xac
(list continues ...)

I'm able to regroup this file into back into its original file(after transferring each one of them), by doing:
#!/bin/sh
cat xaa xab xac xad xae xaf xag > join

However, I do have several other files of such enormity. I noticed that whenever a file is split using the split command, it will always produce files beginning with names xa[a...], no matter if the files are different.

This would be difficult to track if I were to transfer several of those files simultaneously.

Could anyone kindly show me a better way of solving this problem?

Thanks.
3 REPLIES 3
Karthik S S
Honored Contributor

Re: Using split command to transfer files

split -b 100000K bigfile.tar.gz bigfile

now you will get like bigfileaa, bigfileab ....

Regards,
Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Pete Randall
Outstanding Contributor

Re: Using split command to transfer files

Peter,

According to the man page, "The name of the first output file is name with
aa appended, and so on lexicographically, up to zz (only ASCII letters
are used, a maximum of 676 files). If no output name is given, x is
the default."

So, if you add the optional 'name' paramter, you can control the output file naming to your liking.

"split [-b n[k|m]] [-a suffix_length] [file [name]]"


Pete


Pete
Massimo Bianchi
Honored Contributor

Re: Using split command to transfer files

Hi,
from "man split"

The name of the first output file is name with
aa appended, and so on lexicographically, up to zz (only ASCII letters
are used, a maximum of 676 files). If no output name is given, x is
the default.



So, if you want a different beginning, just specify a name !

HTH,
Massimo