JUST DO IT ~

          我只想當(dāng)個程序員

          dd 測試磁盤讀寫 linux mac

          time dd if=/dev/zero bs=1024 count=1000000 of=./1Gb.file
          dd if=./1Gb.file bs=64k |dd of=/dev/null
          dd if=./1Gb.file bs=1MB |dd of=/dev/null
          time有計時作用,dd用于復(fù)制,從if讀出,寫到of。if=/dev/zero不產(chǎn)生輸出,因此可以用來測試純寫速度。同理of=/dev/null不產(chǎn)生輸入,可以用來測試純讀速度。bs是每次讀或?qū)懙拇笮。匆粋€塊的大小,count是讀寫塊的數(shù)量。
          寫問文件測試
          ~/tmp>  time dd if=/dev/zero bs=1024 count=1000000 of=./1Gb.file
          1000000+0 records in
          1000000+0 records out
          1024000000 bytes (1.0 GB) copied, 2.28148 s, 449 MB/s
          real 0m2.287s
          user 0m0.240s
          sys 0m1.933s
          ~/tmp> dd if=./1Gb.file bs=64k |dd of=/dev/null
          15625+0 records in
          15625+0 records out
          1024000000 bytes (1.0 GB) copied, 2.67729 s, 382 MB/s
          2000000+0 records in
          2000000+0 records out
          1024000000 bytes (1.0 GB) copied, 2.67744 s, 382 MB/s
          ~/tmp> rm -rf 1Gb.file 
          ~/tmp> dd if=./1Gb.file bs=1MB |dd of=/dev/null
          1024+0 records in
          1024+0 records out
          1024000000 bytes (1.0 GB) copied, 2.40457 s, 426 MB/s
          1999872+1023 records in
          2000000+0 records out
          1024000000 bytes (1.0 GB) copied, 2.40462 s, 426 MB/s







          參考:
          http://www.tsingpost.com/articles/201401/344.html


          語法:dd [選項]

          if =輸入文件(或設(shè)備名稱)。

          of =輸出文件(或設(shè)備名稱)。

          ibs = bytes 一次讀取bytes字節(jié),即讀入緩沖區(qū)的字節(jié)數(shù)。

          skip = blocks 跳過讀入緩沖區(qū)開頭的ibs*blocks塊。

          obs = bytes 一次寫入bytes字節(jié),即寫入緩沖區(qū)的字節(jié)數(shù)。

          bs = bytes 同時設(shè)置讀/寫緩沖區(qū)的字節(jié)數(shù)(等于設(shè)置ibs和obs)。

          cbs = byte 一次轉(zhuǎn)換bytes字節(jié)。

          count=blocks 只拷貝輸入的blocks塊。

          conv = ASCII 把EBCDIC碼轉(zhuǎn)換為ASCIl碼。

          conv = ebcdic 把ASCIl碼轉(zhuǎn)換為EBCDIC碼。

          conv = ibm 把ASCIl碼轉(zhuǎn)換為alternate EBCDIC碼。

          conv = block 把變動位轉(zhuǎn)換成固定字符。

          conv = ublock 把固定位轉(zhuǎn)換成變動位。

          conv = ucase 把字母由小寫轉(zhuǎn)換為大寫。

          conv = lcase 把字母由大寫轉(zhuǎn)換為小寫。

          conv = notrunc 不截短輸出文件。

          conv = swab 交換每一對輸入字節(jié)。

          conv = noerror 出錯時不停止處理。

          conv = sync 把每個輸入記錄的大小都調(diào)到ibs的大小(用NUL填充)。

          posted on 2015-07-19 12:12 小高 閱讀(524) 評論(0)  編輯  收藏 所屬分類: 工作環(huán)境搭建GUN命令

          導(dǎo)航

          <2015年7月>
          2829301234
          567891011
          12131415161718
          19202122232425
          2627282930311
          2345678

          統(tǒng)計

          常用鏈接

          留言簿(3)

          隨筆分類(352)

          收藏夾(19)

          關(guān)注的blog

          手冊

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 武义县| 贵溪市| 崇明县| 南川市| 海丰县| 郯城县| 调兵山市| 克山县| 昆明市| 深州市| 郎溪县| 深圳市| 墨竹工卡县| 高青县| 武定县| 德阳市| 株洲市| 天全县| 鹤壁市| 仁寿县| 舟曲县| 景宁| 三亚市| 东明县| 华安县| 晋州市| 延长县| 巴南区| 明光市| 甘孜县| 淳安县| 中江县| 外汇| 义马市| 城固县| 萝北县| 海安县| 新兴县| 安龙县| 江城| 景宁|