I have files like this.


Is there any application (or command line) to check the md5 of all files ?

EDIT: Currently I use cfv from macport. work great without any modification

4 Answers 4


The md5 command will check multiple files for you. Simply list all the files you want after the command. I.e. md5 md1.gz md2.gz md3.gz. It will output the md5 hashes like so:

MD5 (md1.gz) = 1c2c02b085a1bc2fed683eca86c0df02
MD5 (md1.gz) = c5515451d8f90a822457a4a8e4bf1791

If you want just the hashes, use the -q flag, it will print only the hash, without the identifying information.

I'm guessing that you want to compare the hash of the files against that in the corresponding .md5 file. You could write a quick shell script to check each generated hash against the one stored in the .md5 file.

Something like this should work:


for file in "$@"; do
  generatedhash=$(md5 -q "$file")
  storedhash=$(< "$file".md5)
  if [[ $generatedhash != $storedhash ]]; then
    echo "Hash for file '$file 'does not match"

Save that to a text file, call it something like checkmd5.sh and do chmod +x checkmd5.sh in the terminal.

It will print out a warning for all files that don't have a matching hash. It prints nothing if the hashes do match. It's quick and dirty, so apologies if it doesn't work for your particular case. But based on the examples you gave, if you run ./checkmd5.sh md*.gz it should check the hashes of the .gz files against the corresponding .md5 files and tell you if any are bad.

  • I remember using "something" in linux box to do a hash check with multiple file but I can't remember so I wonder if osx have the same thing.
    – Tg0
    Commented Nov 7, 2011 at 21:35
  • 1
    Glad it's what you're looking for. I added a sample script that should work for you.
    – robmathers
    Commented Nov 7, 2011 at 21:42

md5deep is a great cross platform tool to generate and check md5/sha hashes. While it's easy to replicate the recursive hash generation feature in a few lines of shell code, it's not so easy to do that for its hash matching feature.



If want to use a gui, you can try with ff_md5drop


Maybe my own product will help you.
fHash https://github.com/sunjw/fhash
An open source files' hash calculator for Windows and Mac OS X.

  • MD5, SHA1, SHA256 and CRC32.
  • Drag & drop.
  • Integrated with context menu in Explorer/Finder.
  • Support multiple files.
  • 1
    Please read the Help section on self-promotion & disclosure - apple.stackexchange.com/help/promotion
    – Tetsujin
    Commented Nov 24, 2015 at 11:02
  • @Tetsujin I think this is an answer of the question, why it is "-3"? I just came across this question, and I think fHash which is my own product is useful for this situation. And answers above mine are all just a tool's link. So why you don't flag them?
    – Sun Junwen
    Commented Nov 24, 2015 at 12:01
  • Did you read my link? You need to disclose any affiliation to product.
    – Tetsujin
    Commented Nov 24, 2015 at 12:07
  • In general, answers which show how a specific product can be used to solve the specific problem described in the question tend to get better votes than answers which just link to a product together with a generic text. This is especially valid if you promote your own product.
    – nohillside
    Commented Nov 24, 2015 at 12:10

You must log in to answer this question.

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