Huu Phan | Blog Linux operating system | Linux operating system -Blog Huu Phan | www.huuphan.com
huuphan.com. Powered by Blogger.

Explore the world of seamless email management with Zimbra Mail on Linux! Our blog delves into a step-by-step guide on harnessing the potential of Linux commands, providing easy-to-follow how-tos, and unlocking the magic of Bash scripting. Simplify your email administration journey and enhance your skills with our insightful tips and tricks.

Generate and Verify Files with MD5 Checksum in Linux

How to generate and Verify Files with MD5 Checksum in Linux. in my post, to create "checksum" folder and 3 file: file_md5,file2_md5,file3_md5 in "checksum" folder.

You may reading link below :
MD5 sums are 128-bit character strings(numerals and letters) resulting from running the MD5 algorithm.
To create checksum folder with 3 files
$ mkdir checksum
$ echo "huuphan.com" > file_md5
$ echo "Phan Van Huu" > file2_md5
$ echo "huupv" > file3_md5
$ ls -ll
total 12
-rw-r--r-- 1 huupv huupv 13 Jul 13 09:04 file2_md5
-rw-r--r-- 1 huupv huupv  6 Jul 13 09:04 file3_md5
-rw-r--r-- 1 huupv huupv 12 Jul 13 09:03 file_md5

To generate MD5 Checksum on a single file
$ md5sum file_md5
01ff693ecd0492aca683eed0dcd2bb44  file_md5

To generate MD5 Checksum on multiple files
$ md5sum file2_md5 file3_md5
de241737f915f7f10245f8362cfe7cf9  file2_md5
01380acd4b4e611399ee7087bf78642b  file3_md5
To generate MD5 Checksum and ouptut to file
$ md5sum file2_md5 file3_md5 > md5check.txt
$ cat md5check.txt
de241737f915f7f10245f8362cfe7cf9  file2_md5
01380acd4b4e611399ee7087bf78642b  file3_md5

To compare MD5 Checkum output file to current file in directory

$ md5sum -c md5check.txt
file2_md5: OK
file3_md5: OK

if you modify file, then md5sum checksum faild.
$ echo "if you modify file then, md5sum faild" >> file2_md5
$ md5sum -c md5check.txt
file2_md5: FAILED
file3_md5: OK
md5sum: WARNING: 1 computed checksum did NOT match
you run command md5sum again after modify file
$ md5sum file2_md5 file3_md5 > md5check.txt

post new :

Huu Phan | Blog Linux operating system | Huu Phan ~ Zimbra Mail Server,linux,bash script,centos,linux command | www.huuphan.com

This Blog is protected by DMCA.com