File Splitting and Merging

  • warning: mysql_connect() [function.mysql-connect]: Access denied for user 'db11867'@'64.13.192.45' (using password: YES) in /nfs/c01/h11/mnt/11867/domains/linuxfiesta.com/html/gallery/lib/adodb/drivers/adodb-mysql.inc.php on line 348.
  • warning: mysql_connect() [function.mysql-connect]: Access denied for user 'db11867'@'64.13.192.45' (using password: YES) in /nfs/c01/h11/mnt/11867/domains/linuxfiesta.com/html/gallery/lib/adodb/drivers/adodb-mysql.inc.php on line 348.

Lately, i've been asking for some members of this #support-ph channel to have my file uploaded on my site. The file size of this is:

-rw------- 1 pepesmith pepesmith 11168175 2007-02-27 12:59 Gramps226-Win32.exe

I've decided to split it using what was suggested by dekoy. (hail....).

Here's a small howto:

The file is vacation.tar.
$ du -sh vacation.tar
164K vacation.tar
Here the splitting started..

$ split vacation.tar -b 100k

-b 100k switch -b indicates that the size is 100k

$ ls -la xaa xab
-rw-rw-r-- 1 hailthyname hailthyname 102400 Feb 26 17:03 xaa
-rw-rw-r-- 1 hailthyname hailthyname 61440 Feb 26 17:03 xab

Now to join this splitted files..
$ cat xab >> xaa

Issuing md5sum then to verify if the original and merge file matches.

$ md5sum vacation.tar
da1ed9156369219281cf28a727dbcb84 vacation.tar
$ md5sum xaa
da1ed9156369219281cf28a727dbcb84 xaa

If you have a list of splitted files xa*, you may issue the command below to merge it.
$ ls xa* | while read a; do cat $a >> newfile.output; done

I've used the above how-to in the files below.

Note that this is just a partial listing for i've got this snapshot while the uploading in on progress.

To merge the rest of the file i've uploaded, i've used the command below.

ls Gramps226-Win32.exe-* | while read a; do cat $a >> ../Gramps226-Win32.exe; done