Can you 'checksum' a file to see if it was changed?

Phil Howard KA9WGN phil at ux1.cso.uiuc.edu
Wed May 29 11:37:45 AEST 1991


bill at twg.bc.ca (Bill Irwin) writes:

>The answer to this was sitting in my mailbox when I got into the
>office the morning after posting.  Talk about service!
>
>There is a "sum" command that will output a checksum for a file.

This is a useful command, too.  For instance I use it in my crosslink
script which first checks files for like sizes, and if alike, then it
takes the checksum to see if they still might be alike.  The first
file is summed only once a second file is found of the same size.
If the sums match, then the files are compared with "cmp" for the
final determination.  If they are identical, they are hardlinked.
Cuts down on space in some cases.
-- 
 /***************************************************************************\
/ Phil Howard -- KA9WGN -- phil at ux1.cso.uiuc.edu   |  Guns don't aim guns at  \
\ Lietuva laisva -- Brivu Latviju -- Eesti vabaks  |  people; CRIMINALS do!!  /
 \***************************************************************************/



More information about the Comp.unix.programmer mailing list