Subject: Re: why doesn't NetBSD ship with md5sum or sha1sum?
To: Jukka Salmi <j+nbsd@2006.salmi.ch>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 04/20/2006 09:45:48
On Thu, 20 Apr 2006, Jukka Salmi wrote:
> I wonder why the BSD checksum tools don't offer an option similar
> to the `-c <file>' option the coreutils tools have to check files
> against a list of filename-checksum tuples. I think this is quite
> useful...
Yes, it is useful.
As a similar feature, mtree(1) can do the same thing.
The format of the "list of filename-checksum tuples" is different, but
works the same.
In fact, mtree is a lot better because it can check multiple checksums,
hashes, and various other attributes.
For example to build a specification:
mtree -c -p /etc -k md5 > etc.mtree.list
(Note that mtree will stop if it doesn't have permissions so the list will
be incomplete if you run as a normal user. Maybe there is an option or
could be an option to continue on errors -- such as no permission.)
Then to check:
mtree -f etc.mtree.list -p /etc
Have a look at the -k and -K flags...
Jeremy C. Reed
echo '9,J8HD,fDGG8B@?:536FC5=8@I;C5?@H5B0D@5GBIELD54DL>@8L?:5GDEJ8LDG1' |\
sed ss,s50EBsg | tr 0-M 'p.wBt SgiIlxmLhan:o,erDsduv/cyP'