BSD md5 vs GNU md5sum输出格式? [英] BSD md5 vs GNU md5sum output format?
问题描述
任何人都知道为什么BSD md5程序会以这种格式产生哈希输出...
Any one knows why BSD md5 program produces hash output in this format ...
MD5 (checksum.md5) = 9eb7a54d24dbf6a2eb9f7ce7a1853cd0
...而GNU md5sum会产生更明智的格式?
... while GNU md5sum produces much more sensible format like this?
9eb7a54d24dbf6a2eb9f7ce7a1853cd0 checksum.md5
据我所知,md5sum格式更容易解析并且更有意义.您如何使用md5做md5sum -check
? -p,-q,-r,-t,-x选项是什么意思? man md5
关于这些选项什么也没说! :|
As far as I can tell, the md5sum format is much easier to parse and makes more sense. How do you do md5sum -check
with md5? And what do the -p, -q, -r, -t, -x options mean? man md5
says nothing about those options! :|
推荐答案
在当前的OS X BSD系统上,您可以指定 md5 -r 命令以获取预期的输出.
On current OS X BSD systems you can specify the md5 -r command to get the expected output.
sgwilbur@gura:/vms/DevOps-v3.4$ md5 vmware*
MD5 (vmware-0.log) = 61ba1d68a144023111539abee08f4044
MD5 (vmware-1.log) = 97bc6f22b25833c3eca2b2cc40b83ecf
MD5 (vmware-2.log) = f92a281102710c4528d4ceb88aa0ac9b
MD5 (vmware.log) = 1f7858d361929d4bc5739931a075c0ad
添加 md5 -r 开关可使输出看起来更像我期望的那样,并且更容易与Linux机器产生的linux md5总和进行区分.
Adding the md5 -r switch made the output look more like I was expecting, and easier to diff with the linux md5 sums that were produced from a Linux machine.
sgwilbur@gura:/vms/DevOps-v3.4$ md5 -r vmware*
61ba1d68a144023111539abee08f4044 vmware-0.log
97bc6f22b25833c3eca2b2cc40b83ecf vmware-1.log
f92a281102710c4528d4ceb88aa0ac9b vmware-2.log
1f7858d361929d4bc5739931a075c0ad vmware.log
对我来说,这是最简单的方法,可以很容易地与Linux机器上的 md5sum 命令生成的输出进行区别.
This was the simplest approach for me to make is easy to diff from output generated by the md5sum command on a linux box.
这篇关于BSD md5 vs GNU md5sum输出格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!