On Tue, 2005-05-17 at 15:52 -0500, Bryan J. Smith wrote:
find "${mypath}" -maxdepth 0 -printf "chown %u:%g %p\n" find "${mypath}" -maxdepth 0 -printf "chmod %m %p\n"
NOTE, if you want to save by UID/GID, change %u:%g to %U:%G.
Also, there is a way to save/apply ACLs as well (using getfacl/setfacl). I've been using a variant of this script to save all ACLs into a script when backing up, just in case the backup approach doesn't save them (e.g., I typically limit my use of ACLs to XFS, because xfsdump preserves them, but just in case I use something that cant').