shell中求字符串的md5

shell中求字符串的md5 参考这篇文章http://ubuntuforums.org/showthread.php?t=532594 ~$ echo x x ~$ echo x| od -bc 0000000 170 012 x \n 0000002 ~$ echo x | md5sum 401b30e3b8b5d629635a5c613cdb7919 - ~$ echo -n x | md5sum | awk '{print $1}' 9dd4e461268c8034f5c8564e155c67a6 ~$ php -r 'echo md5("x");' 9dd4e461268c8034f5c8564e155c67a6 # 封装个函数 ~$ md5(){ echo -n $1 | md5sum | awk '{print $1}'; } ~$ md5 x 9dd4e461268c8034f5c8564e155c67a6

February 4, 2010 · notsobad