Copy file permissions from another tree structure
When need to copy a bunch of permissions from a branch to the other, try this:
~/version2$ find . -type f | xargs -I {} chmod --reference {} ../version1/{}
To elaborate, it copies the perms from current dir to version1, and I'm unsure whether xargs will continue if there's no matching file in the target directory - you should test before running on your live FS. – Anders R. Bystrup Mar 6 at 15:41
Source: StackOverflow
Credit goes to user Anders R. Bystrup
Written by Alvaro Garcia
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#