# md5 compare long file list to md5 file contents



## Lexx (Feb 15, 2011)

If anyone can help with this, I would greatly appreciate it. The md5 man page doesn't seem to give any information for doing this.

I have several folders containing lots of files. Each folder contains an md5 file with all file checksums. I would like to checksum each file and compare it to the file contents with the result. In Linux (where I'm coming from), I could simply use the command:


```
$ md5sum -c file.md5
```

Can someone tell me what the FreeBSD command is for md5? Or at least point me in the right direction? Google doesn't seem to provide very good results on what the exact command would be. Any help is welcome.

Thank you in advance.


----------



## anomie (Feb 15, 2011)

I don't know of an exact analogy that is native to FreeBSD. Options for you: 

 Install sysutils/coreutils, which provides the md5sum program. 
 Roll your own little utility that will do what you need (using md5(1) or dgst(1)).


----------



## Pushrod (Feb 15, 2011)

Give security/md5deep a shot.


----------



## gordon@ (Feb 15, 2011)

How about doing something like:


```
md5 * | diff /path/to/md5.checksum -
```


----------



## Alt (Feb 15, 2011)

gordon@'s variant is better cus you can track which file is changed


----------



## Lexx (Feb 16, 2011)

Awesome! Thank you very much. All of the files pinged due to the md5 not being a standard format/layout (as opposed to md5 * > /path/to/file.md5)

@anomie: Good to know. If I decide to use md5sum in the future, I'll remember that.

@Pushrod: Looked that up. Seems to come with a lot of features that may be handy. I'll bookmark that. Thanks.

@gordon@: Worked like a charm (though the md5 format was non-standard). That command is definitely getting written down. Thanks.


----------

