Permissions

Created Tuesday 23 December 2014

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 {} +

Add user to group

http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/
sudo usermod -a -G groupname username



Backlinks: