0

I have two files on ftp location in csv.gz format and their checksum is in .csv.gz.md5 format. I am copying this file in my local system. I am generating check sum for it through md5sum. Now I am comparing it against the copied file.

Now I want to identify any error in a file if there is one and also which file is having an error.

Please help me.

1 Answer 1

2

If csv.gz.md5 was generated using md5sum csv.gz > csv.gz.md5, then you can check using md5sum -c cvs.gz.md5.

$ echo Hello World > something.abc
$ md5sum something.abc > something.abc.md5
$ md5sum -c something.abc.md5 && echo YAY || echo NAY
something.abc: OK
YAY
$ echo Garbage >> something.abc
$ md5sum -c something.abc.md5 && echo YAY || echo NAY
something.abc: FAILED
md5sum: WARNING: 1 computed checksum did NOT match
NAY

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .