l*****u 发帖数: 12114 | 1 I have file A.txt with size 1M and file B.txt with size 512k, Is there any
linux command that can copy B.txt to A.txt's first 512K? |
h***r 发帖数: 726 | 2 if your files are text files,
combine wc, head/tail and cat, you will get it.
【在 l*****u 的大作中提到】 : I have file A.txt with size 1M and file B.txt with size 512k, Is there any : linux command that can copy B.txt to A.txt's first 512K?
|
l*****u 发帖数: 12114 | 3 what if they are not plain text files? I mean, is there any way to replace
the first N bytes of a file with content from another file?
any
【在 h***r 的大作中提到】 : if your files are text files, : combine wc, head/tail and cat, you will get it.
|
w********e 发帖数: 557 | |
l*****u 发帖数: 12114 | 5 比如说 A.dat 大小 1500000 bytes, B.dat 大小 1000000 bytes, 怎么把 A.dat 的前
1000000 bytes写成B.dat的数据? 能给个dd的例子?
【在 w********e 的大作中提到】 : dd
|
w********e 发帖数: 557 | 6 dd if=B.dat of=A.dat bs=1 count=1000000 conv=notrunc
Actually cat handles binary files too. So you can also cat them and then
split it. |
N**D 发帖数: 10322 | 7 perl
【在 l*****u 的大作中提到】 : I have file A.txt with size 1M and file B.txt with size 512k, Is there any : linux command that can copy B.txt to A.txt's first 512K?
|
j*a 发帖数: 14423 | 8 good.原来notrunc是这个意思.
【在 w********e 的大作中提到】 : dd if=B.dat of=A.dat bs=1 count=1000000 conv=notrunc : Actually cat handles binary files too. So you can also cat them and then : split it.
|