- 论坛徽章:
- 0
|
然后dd命令分割普通文本文件:
- [root@linux split]# cat 1.txt
- this is the 1.txt content
- first line
- second line
- [root@linux split]# cat 2.txt
- this is the 2.txt content
- first line
- second line
- third line
- [root@linux split]# cat 1.txt 2.txt >sum.txt
- [root@linux split]# cat sum.txt
- this is the 1.txt content
- first line
- second line
- this is the 2.txt content
- first line
- second line
- third line
- [root@linux split]# ll
- total 24
- -rw-r--r-- 1 root root 49 Mar 20 18:55 1.txt
- -rw-r--r-- 1 root root 60 Mar 20 18:56 2.txt
- -rw-r--r-- 1 root root 109 Mar 20 19:01 sum.txt
- [root@linux split]# dd if=sum.txt of=1.2.txt bs=1 count=49
- 49+0 records in
- 49+0 records out
- 49 bytes (49 B) copied, 0.00130533 seconds, 37.5 kB/s
- [root@linux split]# diff 1.txt 1.2.txt
- [root@linux split]# cat 1.2.txt
- this is the 1.txt content
- first line
- second line
- [root@linux split]# dd if=sum.txt of=2.2.txt ibs=1 skip=49 bs=1 count=60
- 60+0 records in
- 60+0 records out
- 60 bytes (60 B) copied, 0.00153774 seconds, 39.0 kB/s
- [root@linux split]# diff 2.txt 2.2.txt
- [root@linux split]# cat 2.2.txt
- this is the 2.txt content
- first line
- second line
- third line
- [root@linux split]# ll
- total 40
- -rw-r--r-- 1 root root 49 Mar 20 19:01 1.2.txt
- -rw-r--r-- 1 root root 49 Mar 20 18:55 1.txt
- -rw-r--r-- 1 root root 60 Mar 20 19:02 2.2.txt
- -rw-r--r-- 1 root root 60 Mar 20 18:56 2.txt
- -rw-r--r-- 1 root root 109 Mar 20 19:01 sum.txt
- [root@linux split]#
复制代码 测试没有问题! |
|