Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 4 down vote accepted

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 and do chmod +x 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 ./ md*.gz it should check the hashes of the .gz files against the corresponding .md5 files and tell you if any are bad.

share|improve this answer
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 Nov 7 '11 at 21:35
Glad it's what you're looking for. I added a sample script that should work for you. – robmathers Nov 7 '11 at 21:42

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

share|improve this answer

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.

share|improve this answer

Maybe my own product will help you.
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.
share|improve this answer
Please read the Help section on self-promotion & disclosure - – Tetsujin Nov 24 '15 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 Nov 24 '15 at 12:01
Did you read my link? You need to disclose any affiliation to product. – Tetsujin Nov 24 '15 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. – patrix Nov 24 '15 at 12:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.