1. dd命令簡(jiǎn)述:
if=輸入文件, of=輸出文件, ibs=一次讀取字節(jié)數(shù), obs=一次寫入字節(jié)數(shù), bs=設(shè)置一次讀取寫入的字節(jié)數(shù), skip=跳過的bs數(shù), count=拷貝的塊數(shù)
2. 使用/dev/null和/dev/zero
1. 把/dev/null看作"黑洞", 它等價(jià)于一個(gè)只寫文件, 所有寫入它的內(nèi)容都會(huì)永遠(yuǎn)丟失
2. /dev/zero是一個(gè)偽文件, 但它實(shí)際上產(chǎn)生連續(xù)不斷的null的流
3. 測(cè)試U盤讀寫速度
## 切入u盤目錄,測(cè)試寫入速度# dd if=/dev/zero of=./largefile bs=8k count=1000010000+0 records in10000+0 records out81920000 bytes (82 MB) copied, 11.0626 s, 7.4 MB/s## 測(cè)試讀取速度 (清除緩存)# sudo sh -c "sync && echo 3 > /PRoc/sys/vm/drop_caches" # dd if=./largefile of=/dev/null bs=8k8000+0 records in8000+0 records out65536000 bytes (66 MB) copied, 2.90366 s, 22.6 MB/s
來源:互聯(lián)網(wǎng)
新聞熱點(diǎn)
疑難解答
圖片精選