coreutils: Copying Permissions
1
1 27.2.2 Copying Existing Permissions
1 -----------------------------------
1
1 You can base a file’s permissions on its existing permissions. To do
1 this, instead of using a series of ‘r’, ‘w’, or ‘x’ letters after the
1 operator, you use the letter ‘u’, ‘g’, or ‘o’. For example, the mode
1
1 o+g
1
1 adds the permissions for users who are in a file’s group to the
1 permissions that other users have for the file. Thus, if the file
1 started out as mode 664 (‘rw-rw-r--’), the above mode would change it to
1 mode 666 (‘rw-rw-rw-’). If the file had started out as mode 741
1 (‘rwxr----x’), the above mode would change it to mode 745 (‘rwxr--r-x’).
1 The ‘-’ and ‘=’ operations work analogously.
1