How to change the group of a file want others to access
1. Go into terminal
2. Navigate to the folder you'd like to change permissions on using cd and ls. Use ls -l to find out what permissions currently exist on a certain file or folder.
3. Type in chgrp -R newgroupname foldername
(use -R (which stands for "recursive") if you want to change the permissions of everything in a certain folder, otherwise just type a filename)
(for example to change the group of the RAs folder to staff, in /p/hlp/ I would type chgrp -R staff RAs)
4. To change permissions on a certain file, Use the chmod command. It will take arguments like chmod g+w RAs . This would allow everyone in the group "staff" to write things in the RAs folder.
1. chmod in detail
Unix files have three kinds of permissions (read, write, execute) for three parties (user, group, other).
On the command line:
- The parties are abbreviated as u, g, and o.
- The permissions are abbreviated as r, w, and x.
- You give permissions with a + and take them away with a -
To give everyone full permission to a file:
chmod ugo+rwx filename
That's generally considered too much, so next we'll take away write and execute from other:
chmod o-wx filename
And then take away execute from the group:
chmod g-x filename
But to get that result in the first place we could do:
chmod g+rw filename chmod o+r filename
What if you wanted to do that in one step? Well, it's possible. Permissions can also be set using a numerical system, where read = 4, write = 2, and execute = 1. The parties are represented positionally under this system in the order user, group, other. So to give full (rwx) permission to the user, read and write (rw) to the group and read (r) to other:
chmod 764 filename