How to Generate md5 checksum for all Files in a Directory

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

About Author:

I am a Linux Administrator and Security Expert with this site i can help lot's of people about linux knowladge and as per security expert i also intersted about hacking related news.TwitterFacebook

Newer Post
Older Post


Post a Comment