Skip to main content

md5sum example

5 Practical “md5sum” Command Usage Examples in Linux

This tutorial explains Linux “md5sum” command, options and its usage with examples.
“md5sum” command is used to compute and check MD5 message digest. This post describes “md5sum” command used in Linux along with usage examples and/or output. Usage:
md5sum [OPTION]… [FILE]…
The MD5 message-digest algorithm is a widely used cryptographic hash function that produces a 128-bit (16-byte) hash value.Two non identical files will never have the same md5sum value.However, it has since been shown that MD5 is not collision resistant;[3] as such, MD5 is not suitable for applications like SSL certificates or digital signatures that rely on this property.
Here’s the listing of example usage of “md5sum” command:
1. To calculate md5sum(md5sum file_path):
sanfoundry-> md5sum out.txt 
fa328c3f84352dc7ff5e32bba2ac833c  out.txt
Note
md5sum command is not usable for the directories.
2. To compute and verify checksum of files(md5sum -c file_path):
sanfoundry-> md5sum *.txt 
d41d8cd98f00b204e9800998ecf8427e  1.txt
743268534af6fb128bf4dd7f4914b1c8  2.txt
d41d8cd98f00b204e9800998ecf8427e  link.txt
fa328c3f84352dc7ff5e32bba2ac833c  out.txt
sanfoundry-> md5sum *.txt > x.md5
sanfoundry-> md5sum -c x.md5 
1.txt: OK
2.txt: OK
link.txt: OK
out.txt: OK
“-c” option checks the status of the files and if there is any change it gives error.
sanfoundry-> vi 1.txt 
sanfoundry-> md5sum -c x.md5 
1.txt: FAILED
2.txt: OK
link.txt: OK
out.txt: OK
md5sum: WARNING: 2 computed checksums did NOT match
If link.txt is the link file of 1.txt then it also get changed and md5sum also FAILED to cross verify it.
sanfoundry-> vi 1.txt 
sanfoundry-> md5sum -c x.md5 
1.txt: FAILED
2.txt: OK
link.txt: FAILED
out.txt: OK
md5sum: WARNING: 2 computed checksums did NOT match
3. To read in binary mode(md5sum -b file_path):
sanfoundry-> md5sum 1.txt 
764efa883dda1e11db47671c4a3bbd9e  1.txt
sanfoundry-> md5sum -b 1.txt 
764efa883dda1e11db47671c4a3bbd9e *1.txt
sanfoundry-> md5sum --binary 1.txt 
764efa883dda1e11db47671c4a3bbd9e *1.txt
“-b” option is equivalent to “–binary” option.
Treat all input files as binary. This normally does not make any difference on UN*X systems but some systems have a different internal and external representation of texts (especially the end-of-line characters).
4. To read in text mode(md5sum -t file_path):
Treat all input files as text files. This is the reverse option to –binary.
sanfoundry-> md5sum -t 1.txt 
764efa883dda1e11db47671c4a3bbd9e  1.txt
5. To print version information on standard output then exit(md5sum -v):
sanfoundry-> md5sum --version
md5sum (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
 

Comments

Popular posts from this blog

Wordpress hacking - How to install / run wpscan on windows xp / windows 7 / windows 10

HOW TO RUN WPSCAN ON WINDOWS Byrockstardevil Requirements: rubyinstaller Development Kit for rubyinstaller curl DLL for windows : libcurl.dll 1 - install rubyinstaller you must have Ruby 2.2.3 version . download links here : http://rubyinstaller.org/downloads/ for more info : https://github.com/oneclick/rubyinstaller/wiki 2 - install Development Kit for rubyinstaller download link : http://rubyinstaller.org/downloads/ how to install : https://github.com/oneclick/rubyinstaller/wiki/Development-Kit if you face that problem  "unknown encoding name -  (ArgumentError)" just type "chcp 1252" in cmd and hit enter 3 - install libcurl.dll A - Download libcurl.dll from : http://www.confusedbycode.com/curl/ B - copy libcurl.dll copy  libcurl.dll into ruby bin folder or wpscan folder and make sure to add it to your PATH. I also added .DLL to PATHEXT ex : C:\Ruby21-x64\bin\ you can visit : http://www.computerhope.com/issues/ch000549.htm to know to set the p

How To Generate Random IP Address Using JAVA ?

Today I'll Show You How To Generate Random IP Address... But First Why I Want This...Right...? Ans : If You Want Test Your Code That Whether It Is Recognizing The Machine By It’s IP Address Then You Had To Use This Code To Generate Random IP Address. So Here We Goooo.... private String generateIPAddress ( int p1 , int p2 , int p3 ) { StringBuilder sb = null ; Random r1 = new Random (); Random r2 = new Random (); Random r3 = new Random (); Random r4 = new Random (); String ip1 = Integer . toString ( b1 ); String ip2 = Integer . toString ( b2 ); String ip3 = Integer . toString ( b3 ); String ip4 = Integer . toString ( b4 ); String b1 = IpConverter . longToIp ( r1 . nextLong ()); String b2 = IpConverter . longToIp ( r2 . nextLong ()); String b3 = IpConverter . longToIp ( r3 . nextLong ()); String b4 = IpConverter . longToIp ( r4 . nextLong ()); //Now the I

3 Ways to Root Android 7.0 Nougat on Nexus Running Official AOSP [Update: Root Android 7.1]

3 Ways to Root Android 7.0 Nougat on Nexus Running Official AOSP [Update: Root Android 7.1] If you own a Nexus phone then chances are you have already updated your device with the latest official Android 7.0 Nougat firmware. This brings the newer firmware build number NRD90M to the Nexus range including the Nexus 5X, 6P, 9, 6, Nexus Player, and the Pixel C. Unfortunately, Nexus 5 and 7 were left behind. This has been a game-changing week for the Android community as you can now expect the new software for your Android device soon enough. It may either come officially from a manufacturer or unofficially from developers like CyanogenMod. Just like we saw the unofficial support for the  Nexus 5 and the Nexus 7  today. As the new AOSP source code is now available to developers, soon you may find Cyanogen 14 based custom ROMS releasing for several devices. Hence, to be ready, you may need to be rooted and also setup a custom recovery like TWRP on your device. So that once the CM 14 bas