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.
Advertisement
# 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