How to create and compare md5 checksum of files

To create md5 checksum of all files in folder use command:

md5sum /etc/*

This comment will show all md5 checksum in /etc directory:

To write this checksum in text document use command:

md5sum /etc/* >> /file.txt

To compare checksum of files in folder with checksum of files in text document use command:

md5sum -c /file.txt

If checksums match, near the file will be record “Success”, it means that the file has not changed. Otherwise it means that the file was edited by someone.

To check your system, regularly create checksum files for directories: /etc, /bin, /sbin, / lib

Use md5sub recursive in sub-directories

If You want to create md5 checksum of all files in all sub-directories use next command, it will create md5 checksum of all files in /etc directory:

find -type f -exec md5sum '{}' \; > md5sum.txt