cksum entire dir??

Jonathan McKeown j.mckeown at ru.ac.za
Thu Sep 13 08:23:51 UTC 2012


On Wednesday 12 September 2012 22:29:45 Gary Kline wrote:

> 	how, with mtree, could I tell  whether dir1 == dir2 or not?

From the manpage:

``The mtree utility compares the file hierarchy rooted in the
current directory against a specification read from the standard
input.  Messages are written to the standard output for any files
whose characteristics do not match the specifications, or which
are missing from either the file hierarchy or the specification.''

So you run mtree twice, once against dir1 with the -c option to output the 
specification for the directory tree to stdout (which you can capture to a 
file, or pipe straight into the second invocation) and once against dir2 with 
the output of the first one as input (either in a pipeline, or by using -f 
with the filename of the captured output).

Jonathan


More information about the freebsd-questions mailing list