dd中的conv=notrunc

[root@lucky ~]# dd if=/dev/zero of=zero.txt bs=1024 count=1
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 9.2e-05 seconds, 11.1 MB/s

[root@lucky ~]# ls -l zero.txt 
-rw-r--r-- 1 root root 1024 12-06 13:53 zero.txt
[root@lucky ~]# dd if=/dev/zero of=zero.txt bs=512 count=1 conv=notrunc
1+0 records in
1+0 records out
512 bytes (512 B) copied, 4.8e-05 seconds, 10.7 MB/s

[root@lucky ~]# ls -l zero.txt 
-rw-r--r-- 1 root root 1024 12-06 13:53 zero.txt

[root@lucky ~]# dd if=/dev/zero of=zero.txt bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 4.4e-05 seconds, 11.6 MB/s

[root@lucky ~]# ls -l zero.txt 
-rw-r--r-- 1 root root 512 12-06 13:53 zero.txt

你可能感兴趣的:(LINUX&UNIX)