Skip to content

How to Generate and Verify md5 checksum of File in Linux

Advertisement

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

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Leave a Reply

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


Back to top