find

Created Saturday 27 September 2014

http://content.hccfl.edu/pollock/unix/findcmd.htm

Change permissions for user to be equal to group

sudo find . \( \( -type d -o -type f \) ! -path ".git/*" \) -printf '%04m%p\0' | perl -n0e 'unless (/^.(.)\1/) {$p1=substr($_,1,1);$p2=substr($_,2,1);$p3=substr($_,3,1);$n=substr($_,4);system("sudo chmod $p1$p1$p3 $n");}'

OR
http://serverfault.com/questions/284428/copy-a-files-owner-permissions-to-group-permissions
sudo chmod -R g=u
find /patch/to/change/perms -name '*.txt' -exec chmod g=u {} +



Backlinks: