- 论坛徽章:
- 0
|
请教如何将文件进行分割?
原帖由 "tired_bird" 发表:
请教如何将文件进行分割?
我在linux下,将一个文件打包后为2.9G,然后我把它通过移动硬盘来拷贝,但只能拷出为2.0G一个文件,何故?我又该如何把它分割成两份文件呢?
还望指教,谢先!
可以用dd做:
如:要切割的大文件为test1,共98888888字节,那么在本地机上做:
dd if=test1 of=out1 bs=1 count=20000000
dd if=test1 of=out2 bs=1 count=20000000 skip=20000000
dd if=test1 of=out3 bs=1 count=20000000 skip=40000000
dd if=test1 of=out4 bs=1 count=20000000 skip=60000000
dd if=test1 of=out5 bs=1 count=18888888 skip=80000000
生成5个out文件,每个文件20M上传到另外一个host上。
在另外一个host上在合并5个out文件:
dd if=out1 of=xtest1 bs=1 count=20000000
dd if=out2 of=xtest1 bs=1 count=20000000 seek=20000000
dd if=out3 of=xtest1 bs=1 count=20000000 seek=40000000
dd if=out4 of=xtest1 bs=1 count=20000000 seek=60000000
dd if=out5 of=xtest1 bs=1 count=18888888 seek=80000000
以上方法在unxi5.0.5下通过。 |
|