Pages

Wednesday, April 5, 2017

About md5 sum command

Md5sum – 

md5sum is used to verify that a file has not changed as a result of a any faults during file transfer and due to disk errors.

List of Options

-b    - read file in binary mode
-c    - check md5sum against given list
-t    - read file in text moded

md5sum <filename> >  [file.md5] = checksum file

md5sum –c [filename.md5] above command will show error if the file is modified

[root@server2 ~]# md5sum one23
54c2983639fae5b4ed67a0a9502db922  one23

[root@server2 ~]# md5sum one23 > 123

[root@server2 ~]# vi one23

[root@server2 ~]# md5sum -c 123
one23: FAILED
md5sum: WARNING: 1 of 1 computed checksum did NOT match

[root@server2 ~]# vi one23

[root@server2 ~]# md5sum -c 123

one23: OK

server2 ~]# cat 123
54c2983639fae5b4ed67a0a9502db922  one23

1 comment:

  1. The md5sum command, is used to calculate and print the hash of the given file. This is a handy tool if you're looking for a quick way to see what's changed in your files.
    https://codeprozone.com/code/shell/19144/md5sum-windows.html

    ReplyDelete