Generate md5 checksum:
find . -exec md5sum “{}” \; > /tmp/wwwmd5.list
Above command will generate md5 checksum for all files in current directory and its sub-directory and store it in /tmp/mymd5.list file.
Generate MD5:
If we want to generate md5sum of all files in our home directory and its sub-directory. Use the following command.# find ~/ -exec md5sum "{}" \; > ~/usermd5.list
If we want to generate md5sum for specific files for example all php and JavaScript files under public_html directory use following command.
# find ~/public_html/ -name "*.php" -exec md5sum "{}" \; > ~/usermd5.list # find ~/public_html/ -name "*.js" -exec md5sum "{}" \; >> ~/usermd5.list
Verify MD5:
Now verify all files using generated md5sum file using following command. This command will show output as OK or FAILD.# md5sum -c ~/usermd5.list
No comments:
Post a Comment