split file to pieces and restore under linux
Posted on 2012-05-30 17:38 Milo的海域 閱讀(280) 評論(0) 編輯 收藏 所屬分類: LinuxSometime mailbox disallows u upload file exceed some limitation. you can split it before upload. here is one example:
create test file
split file to segment with size as u wished
restore file from segments
verify the restore
Generally, the check result should be same.
create test file
touch file1 file2;
echo 1 > file1;
echo 2 > file2;
tar zvcf old.tar.gz file1 file2;
echo 1 > file1;
echo 2 > file2;
tar zvcf old.tar.gz file1 file2;
split file to segment with size as u wished
split -b 50 old.tar.gz;
restore file from segments
cat xa* > new.tar.gz;
verify the restore
md5sum old.tar.gz new.tar.gz
Generally, the check result should be same.