Re: [Hampshire] diffing a directory structure?

Top Page
Author: Hugo Mills
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] diffing a directory structure?

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x57649100.hantslug.org.uk.27626': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Sun Jul 8 12:17:22 2007 BST
gpg: using DSA key B2C27BC21C335860
gpg: Can't check signature: No public key
On Sun, Jul 08, 2007 at 06:23:59AM -0400, Andy Random wrote:
> I'm looking for a way to diff two directory structures, preferably from
> the command line and in particular I'd like to compare file permissions
> between the trees. Any suggestions on the best way to do this?


find dir1 -type f | xargs stat -c "%n %f" | sort >dir1.perms
find dir2 -type f | xargs stat -c "%n %f" | sort >dir2.perms
diff -u dir1.perms dir2.perms

Usual caveats about spaces in filenames. Use -print0 and -0 for
find and xargs respectively if you have problems.

Hugo.

--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
PGP key: 1C335860 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
--- Startle, startle, little twink. How I wonder what you think. ---