On Wed, Aug 09, 2000 at 12:30:09AM -0400, Daniel Freedman wrote:
> I'm trying to use md5sum (from Gnu Text Utilities) to compute a checksum
> for alot of files in my home directory or root directory. This wouldn't be
> a problem, except that I want it to compute the checksums on all files in
> ALL subdirectories (so that I can compare original with backup copy).

the standard trick with any command that doesn't recurse directories
itself, is to use find(1):

 md5sum `find . -type f -print` > md5.list

ie: build a list of all filenames (type f) starting from . and build a
command line out of them


the problem with this (esp in this case) is that the command line is
quite likely to get too long, so you use xargs(1):

 find . -type f -print | xargs md5sum > md5.list

xargs reads arguments from stdin and runs the given command several
times, passing some of the arguments each time (such that the command
line never gets too long).


there are programs to do exactly what you are doing (checksum of files
for future comparison). "tripwire" being the classic example. since
you'd prefer a GPL'd program, look for "aide" instead.

-- 
 - Gus


--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to