Skip to content

How to Generate and Verify md5 checksum of File in Linux

How to Generate and Verify md5 checksum of File in Linux. Verify File integrity using generating md5 checksum of file and verify it

On this page

Command:

md5sum myfile.php > myfile.php.md5

Above command will generate md5 checksum of file myfile.php and store in file myfile.php.md5. myfile.php.md5 can be used to verify integrity of file anytime.

Generate MD5:

If we want to generate md5sum of a file named index.php. Use the following command to do it and store generated md5 value of file in index.php.md5 file.

# md5sum index.php > index.php.md5

Verify MD5:

Now in future we can use index.php.md5 to verify integrity of file using following command. This command will show output as OK or FAILD.

# md5sum -c index.php.md5

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top