« Simple anti-spam measureHOWTO: Install and Configure ssh »

HOWTO: Split Large Files and Rebuild Them

31/07/08

Permalink 08:48:22 am, by richard Email , 204 words   English (GB)
Categories: Ubuntu Linux, Filing Systems

HOWTO: Split Large Files and Rebuild Them

The other day I needed to transfer a 3.8G file over ftp. The problem was that the ftp server timed out and logged me out when only around a third of the file was transferred.

So I need to split the file into small chunks and send those. Then you have the problem of sticking all the fragments back together again. Thankfully I'm not on Windows &#59;) I use Linux so this was all done with standard Linux commands.

...

first i split the file into 500Mb fragments.

split -b 500m myfile

This gave me the following

-rw-r--r--  1 richard richard 3.8G Jul 29 12:08 myfile 


-rw-r--r--  1 richard richard 500M Jul 31 08:28 xaa 
-rw-r--r--  1 richard richard 500M Jul 31 08:29 xab 
-rw-r--r--  1 richard richard 500M Jul 31 08:29 xac 
-rw-r--r--  1 richard richard 500M Jul 31 08:29 xad 
-rw-r--r--  1 richard richard 500M Jul 31 08:30 xae 
-rw-r--r--  1 richard richard 500M Jul 31 08:30 xaf 
-rw-r--r--  1 richard richard 500M Jul 31 08:30 xag 
-rw-r--r--  1 richard richard 326M Jul 31 08:31 xah

Once I had transferred the file, I needed to put it back together again.

cat xa? > myfile

As the files are split and use an alphabetical sequence in their names we can use the pattern matching to put them back in the right order. There is no need to name all the files.


No feedback yet

Here are a collection of Mini-HOWTOs some of which are too short even for that grand title. I keep them around as it is easier to remember where to look these up that to remember the content of the mini-HOWTO

Search

Contents

blogging software