MD5 checksum from command line

The MD5 Message-Digest Algorithm is a widely used cryptographic hash function that produces a 128-bit (16-byte) hash value. Specified in RFC 1321, MD5 has been employed in a wide variety of security applications, and is also commonly used to check data integrity. MD5 was designed by Ron Rivest in 1991 to replace an earlier hash function, MD4. An MD5 hash is typically expressed as a 32-digit hexadecimal number.

For more details about MD5 check this link.

There is a command called md5sum in Linux which is to generate md5 chedksum from command line for a given file.

We can use it find duplicate files with same content and different names.

How to generate md5 checksum:

$ md5sum <inputFileName>


$ md5sum

Output: 851a5ff4bd487c39a1c71458f59a5926

$ md5sum

output: 851a5ff4bd487c39a1c71458f59a5926

In above example for both files, and md5 checkusum is same,  that means the content in both files is same. So we can get rid of one of the file. This is one of the use case for md5sum, and I will use it to identify the duplicate file names.


Leave a Reply

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

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s