[QuickTips] Install md5sum & sha1sum on Mac OS X using Homebrew

Use following HomeBrew command to install md5sum & sha1sum

 brew install md5sha1sum

You can use ‘md5sum’ as below:

#Create a new file using echo.
root# echo hello>>testfile.txt

#Find md5 has for the created file.
root# md5sum testfile.txt
b1946ac92492d2347c6235b4d2611184  testfile.txt

Mac OS X also provides an inbuilt ‘md5’ utility which has similar functionality as ‘md5sum’. You can use ‘md5’ with ‘-r’ switch to get similar output as ‘md5sum’.

root#  md5 testfile.txt
MD5 (testfile.txt) = b1946ac92492d2347c6235b4d2611184
root#  md5 -r testfile.txt
b1946ac92492d2347c6235b4d2611184 testfile.txt

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s