Last Updated: February 25, 2016
· alvarogarcia7

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