<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[[实践OK]Mac下安装md5sum和linux下的md5sum使用和输出一样，不一样的FreeBSD 11.1下的md5和Linux下的md5sum不一样输出格式统一成md5deep以及自己编译出Linunx一样的md5sum可执行文件的瞎折腾。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Thu, 10 May 2018 07:10:04 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	Mac下安装md5sum：https://blog.csdn.net/cup_chenyubo/article/details/52982986<br/>brew install md5sha1sum<br/><br/>背景：公司网不好传入rz -bye的稍微大点的文件就断开了，再运行rz -bye,还会继续重头再传（只要失败再SSH上去运行rz -bye就会继续传，和默认SSH的目录无关，这个有点意思，但要是rz -bye支持断点上传就好了。），于是这就有一个比对文件是否是真的传上去了的md5sum比对，而Linux下有md5sum filename，FreeBSD下有md5,但输出格式和Linux下的不大一样，但都是求Md5，于是找了找，发现一个叫md5deep的可以Port安装，输出还和Linux下的一样，相当友好，偶尔会用到，记录三种都能达到目录，个人认为以第二种较为精简有力，符合Linux思想，现在用FreeBSD多吗？嘿嘿。<br/><br/>零）系统自己默认的md5也能求出文件内容的md5值：<br/>md5 harbor-offline-installer-v1.2.0.tgz <br/>MD5 (harbor-offline-installer-v1.2.0.tgz) = 235fcfb9fe00ad61f6cbc2de4920b477<br/>#which md5<br/>/sbin/md5<br/>#ln -sf /sbin/md5 /sbin/md5sum&nbsp;&nbsp;#作个软链接且名字修改成md5sum<br/>#md5sum harbor-offline-installer-v1.2.0.tgz&nbsp;&nbsp;#SecureCRT下新开SSH窗口：<br/>MD5 (harbor-offline-installer-v1.2.0.tgz) = 235fcfb9fe00ad61f6cbc2de4920b477<br/><br/>==== 上面格式和Linux有点出入，找到一个和Linux一样的类似md5sum的Port安装包命令md5deep====<br/><br/>一)/usr/port/security/md5deep<br/>make &amp;&amp; make install<br/>上面这个md5deep的输出和Linux的md5sum一样的：<br/>On FreeBSD：<br/>#md5deep /opt/harbor-offline-installer-v1.2.0.tgz <br/>235fcfb9fe00ad61f6cbc2de4920b477&nbsp;&nbsp;/opt/harbor-offline-installer-v1.2.0.tgz<br/><br/>On Linux：<br/>#md5sum&nbsp;&nbsp;harbor-offline-installer-v1.2.0.tgz&nbsp;&nbsp; <br/>235fcfb9fe00ad61f6cbc2de4920b477&nbsp;&nbsp;harbor-offline-installer-v1.2.0.tgz<br/><br/><br/>于是这样：<br/>#which md5deep<br/>/usr/local/bin/md5deep<br/>#rm -rf&nbsp;&nbsp;/sbin/md5sum&nbsp;&nbsp;&nbsp;&nbsp;#删除前面的软链接。<br/>vi /root/.cshrc <br/>alias md5sum &#039;/usr/local/bin/md5deep&#039;<br/><br/>#which md5sum<br/>md5sum:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aliased to /usr/local/bin/md5deep<br/><br/>重新开一个FreeBSD的终端，和Linux一样运行md5sum filename获取文件内容的md5值：<br/>#md5sum harbor-offline-installer-v1.2.0.tgz <br/>235fcfb9fe00ad61f6cbc2de4920b477&nbsp;&nbsp;/opt/harbor-offline-installer-v1.2.0.tgz<br/><br/><br/><br/>二)/usr/ports/sysutils/coreutils<br/>make clean<br/>make deinstall<br/>make &amp;&amp; make install<br/>弹出一个窗体，选取消：<br/>coreutils-8.25.tar.xz&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12% of 5590 kB&nbsp;&nbsp;382 kBps 00m20s<br/>md5sum is part of GNU coreutils. The FreeBSD port to install is sysutils/coreutils. This will install all the GNU coreutils with a g prefix, so md5sum will be available as gmd5sum.<br/>安装完后，md5sum生成在这个位置，直接拷贝到/usr/local/bin下面得了：<br/>/usr/ports/sysutils/coreutils/work/coreutils-8.25/src/md5sum /opt/harbor-offline-installer-v1.2.0.tgz <br/>235fcfb9fe00ad61f6cbc2de4920b477&nbsp;&nbsp;/opt/harbor-offline-installer-v1.2.0.tgz<br/>cp -rf /usr/ports/sysutils/coreutils/work/coreutils-8.25/src/md5sum /bin/md5sum&nbsp;&nbsp; #和Linux目录一样。<br/>#which md5sum<br/>/bin/md5sum<br/>#md5sum /opt/harbor-offline-installer-v1.2.0.tgz&nbsp;&nbsp; #/bin/md5sum<br/>235fcfb9fe00ad61f6cbc2de4920b477&nbsp;&nbsp;/opt/harbor-offline-installer-v1.2.0.tgz<br/>#ldd /bin/md5sum<br/>/bin/md5sum:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libc.so.7 =&gt; /lib/libc.so.7 (0x800836000)<br/>我只要这一个coreutils编译出来的md5sum，于是make deinstall卸载掉没有用到的一些东西：<br/>cd /usr/ports/sysutils/coreutils<br/>make clean &amp;&amp; make deinstall<br/>因为它只是用到libc.so.7这个动态链接库，即使卸载掉后，依然能够运行这个md5sum的可执行文件求出输出文件的MD5值：<br/>#md5sum /opt/harbor-offline-installer-v1.2.0.tgz<br/>235fcfb9fe00ad61f6cbc2de4920b477&nbsp;&nbsp;/opt/harbor-offline-installer-v1.2.0.tgz<br/><br/>参考：https://unix.stackexchange.com/questions/439974/how-to-install-md5sum-in-freebsd<br/>文中两Port摘自：https://forums.freebsd.org/threads/md5-compare-long-file-list-to-md5-file-contents.21795/<br/><br/>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]Mac下安装md5sum和linux下的md5sum使用和输出一样，不一样的FreeBSD 11.1下的md5和Linux下的md5sum不一样输出格式统一成md5deep以及自己编译出Linunx一样的md5sum可执行文件的瞎折腾。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>