Linux – Split file into smaller pieces

1. Create a 10MB file named as dummy.

  • dd if=/dev/zero of=dummy bs=1024k count=10

linux-splif-file-1
 

2. Use the split command to break the file into 1MB pieces.

  • split -b 1024k dummy dummy-part-

linux-splif-file-2
 

3. The file will be broken into pieces starting with the file name dummy-part-.
 

4. If you want to merge the pieces, use the cat command.

  • cat dummy-part* > merged

linux-splif-file-3
 

Done =)

Reference: StackOverflow – Split Files using tar ,gz,zip or bzip2

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s