I have a lot of files that I need to check. In a UNIX environment I can simply type:
md5sum --check MD5.txt
and the checksum of each file is calculated and compared against the checksums in MD5.txt. How do I do this in a macOS environment. The closest I found was to run
md5 -r * > output.txt
but then I have to manually compare the checksums against the MD5.txt file.
Is there anyway to do this checkup automatically?
shasum
which does have a-c
option for checking. But needs a script to build the check file for all files in a directory tree.md5 -r * | diff -w MD5.txt -
.