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

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.