linux md5sum 應用__linux

來源:互聯網
上載者:User

首先看個最簡單的例子:
$ md5sum  ./1/iAmCdRom.iso  ./2/iAmCdRom.iso
773682e3494b6155855dd580bef8cb04  ./1/iAmCdRom.iso
34d75a13d98b245c2a32a0bf816abb36  ./2/iAmCdRom.iso

//更多詳細的選項如下:
$ md5sum  --help
Usage: md5sum [OPTION]... [FILE]...
Print or check MD5 (128-bit) checksums.
With no FILE, or when FILE is -, read standard input.

  -b, --binary            read in binary mode
  -c, --check             read MD5 sums from the FILEs and check them
  -t, --text              read in text mode (default)
本人還是推薦binary二進位傳輸
產線的燒錄檔案等,由於涉及到大批量等問題,傳輸過程更不能有任何差錯。
且一般都是二進位檔案。(如ftp工具設定不當:如文字格式設定或二進位傳輸的差別)

當然,你產生了MD5號,最重要的是使用的時候去驗證:
md5sum  youfile >  youfile.md5
md5sum -c  you.md5

舉個栗子:
echo hello > hello.txt
md5sum hello.txt > hello.md5
md5sum  -c hello.md5
hello.txt: OK (ok是我們希望看到的)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.