linux dd命令測試U盤讀寫速度


1. dd命令簡述:

  if=輸入文件, of=輸出文件, ibs=一次讀取字節數, obs=一次寫入字節數, bs=設置一次讀取寫入的字節數, skip=跳過的bs數, count=拷貝的塊數

2. 使用/dev/null和/dev/zero

  1. 把/dev/null看作"黑洞", 它等價於一個只寫文件, 所有寫入它的內容都會永遠丟失

  2. /dev/zero是一個偽文件, 但它實際上產生連續不斷的null的流

3. 測試U盤讀寫速度

## 切入u盤目錄,測試寫入速度
# dd if=/dev/zero of=./largefile bs=8k count=10000
10000+0 records in
10000+0 records out
81920000 bytes (82 MB) copied, 11.0626 s, 7.4 MB/s

## 測試讀取速度 (清除緩存)
# sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"     
# dd if=./largefile of=/dev/null bs=8k
8000+0 records in
8000+0 records out
65536000 bytes (66 MB) copied, 2.90366 s, 22.6 MB/s

 

來源:互聯網


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM