{"id":163,"date":"2023-11-30T16:23:27","date_gmt":"2023-11-30T08:23:27","guid":{"rendered":"https:\/\/www.kz-hub.tech\/?p=163"},"modified":"2023-11-30T17:14:05","modified_gmt":"2023-11-30T09:14:05","slug":"163","status":"publish","type":"post","link":"https:\/\/www.kz-hub.tech\/index.php\/2023\/11\/30\/163\/","title":{"rendered":"md5sum \u7684\u4f7f\u7528"},"content":{"rendered":"<h1>md5sum \u7684\u4f7f\u7528<\/h1>\n<h2>1. \u57fa\u672c\u547d\u4ee4<\/h2>\n<pre><code>$ md5sum --help\nUsage: md5sum [OPTION]... [FILE]...\nPrint or check MD5 (128-bit) checksums.\nWith no FILE, or when FILE is -, read standard input.\n\n  -t, --text           read in text mode (default)\n  -b, --binary         read in binary mode\n  -c, --check          read MD5 sums from the FILEs and check them\n      --tag            create a BSD-style checksum\n  Note: There is no difference between binary and text mode option on GNU system.\n\nThe following four options are useful only when verifying checksums:\n      --quiet          don&#039;t print OK for each successfully verified file\n      --status         don&#039;t output anything, status code shows success\n      --strict         exit non-zero for improperly formatted checksum lines\n  -w, --warn           warn about improperly formatted checksum lines\n\n      --help     display this help and exit\n      --version  output version information and exit\n\nThe sums are computed as described in RFC 1321.  When checking, the input\nshould be a former output of this program.  The default mode is to print\na line with checksum, a character indicating input mode (&#039;*&#039; for binary,\nspace for text), and name for each FILE.<\/code><\/pre>\n<h2>2. \u9a8c\u8bc1\u6587\u4ef6\u662f\u5426\u88ab\u7be1\u6539<\/h2>\n<p>\u628a\u4e0b\u8f7d\u7684\u6587\u4ef6file\u548c\u8be5\u6587\u4ef6\u7684file.md5\u62a5\u6587\u6458\u8981\u6587\u4ef6\u653e\u5728\u540c\u4e00\u4e2a\u76ee\u5f55\u4e0b\uff0c\u7136\u540e\u7528\u5982\u4e0b\u547d\u4ee4\u8fdb\u884c\u9a8c\u8bc1\uff1a<\/p>\n<pre><code>md5sum -c file.md5<\/code><\/pre>\n<p>md5sum\u547d\u4ee4\u8fd8\u53ef\u4ee5\u4e00\u6b21\u9a8c\u8bc1\u591a\u4e2a\u6587\u4ef6\u3002\u5982\u679c\u5c06\u6240\u9700\u9a8c\u8bc1\u7684\u6587\u4ef6\u540d\u5199\u5165\u4e00\u4e2a\u5355\u72ec\u7684\u6587\u4ef6\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u8be5\u6587\u4ef6\u68c0\u67e5\u662f\u5426\u6709\u4efb\u4f55\u6587\u4ef6\u5df2\u66f4\u6539\u3002<\/p>\n<pre><code>$ md5sum file1.txt file2.txt file3.txt &gt; hashes\n$ md5sum --check hashes\nfile1.txt: OK\nfile2.txt: OK\nfile3.txt: OK<\/code><\/pre>\n<h2>3. \u6279\u91cf\u67e5\u770bmd5\u503c<\/h2>\n<pre><code class=\"language-bash\">md5sum filename &gt; filename.md5 # \u521b\u5efa\u5355\u72ec\u7684md5\u6587\u4ef6\nmd5sum *.filename &gt; filename.md5 # \u5c06\u6240\u6709\u6587\u4ef6\u7684md5\u8f93\u5165\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\n\n# \u8ba9\u6bcf\u4e2a\u6587\u4ef6\u5355\u72ec\u751f\u6210\u4e00\u4e2amd5\u6587\u4ef6\nfor n in `ls *.fastq.gz`; do md5sum $n &gt; ${n%.fastq.gz}.md5; done\n\n# \u521b\u5efash\u6587\u4ef6\u7528\u4e8e\u6279\u91cf\u8fd0\u884c\nfor n in `ls *.fastq.gz`; do echo &quot;md5sum $n &gt; ${n%.fastq.gz}.md5&quot;&gt;&gt;createmd5.sh; done\n\nfor n in `ls * R?.fq.gz`; do echo &quot;md5sum $n &gt; ${n%.fq.gz}.md5&quot;&gt;&gt;createmd5.sh; done<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>md5sum \u7684\u4f7f\u7528 1. \u57fa\u672c\u547d\u4ee4 $ md5sum &#8211;help Usage: md5sum [OPTIO&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-163","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/comments?post=163"}],"version-history":[{"count":4,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/163\/revisions"}],"predecessor-version":[{"id":169,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/163\/revisions\/169"}],"wp:attachment":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/media?parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/categories?post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/tags?post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}