Split a file into several smaller pieces

General discussion about PLUC and Linux in Pakistan.
Post Reply
kashif
Naib Subedar
Posts: 305
Joined: Wed Oct 15, 2003 2:44 am
Location: Okara

Split a file into several smaller pieces

Post by kashif »

Cutting down or splitting a file to several smaller pieces have great benefits. A large file split into several smaller files can easilly fit in a CD or floppy disk or even transferred over the network. Splitting the file is possible using the split command.

Below is an example on how to use the split command:

Using split on a 5.3MB image.iso file:

split -b 1400k image.iso

It will generate 4 files with the following file sizes:

1404k xaa
1404k xab
1404k xac
1208k xad

To recreate the file, the cat command can be
used.

cat xa* > new-image.iso

The split and cat commands are provided by the coreutils package. Once the new new-image.iso file is restored, its possible to delete the other split files.

Note: To verify that the file has been correctly restored, use the command md5sum before and after splitting the file. Syntax:

md5sum [filename]







http://www.redhatmagazine.com/2007/01/1 ... er-pieces/
**********************************************

As-Salaatu was-Salaamu Alaika Ya Sayyidi Ya Rasool ALLAH

**********************************************
kbukhari
Major General
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Location: Lahore
Contact:

Post by kbukhari »

Hmm Good idea
and it was really new thing for me to learn
--
Syed Kashif Ali Bukhari
+92-345-8444420
http://sysadminsline.com
http://kashifbukhari.com
Post Reply