Add group rwx permissions to a folder

I have a folder named docs, how do I add rwx permissions for group devs to docs?

I tried:

chmod -R g+rwx docs

but I don't know where to specify that it's the devs group I want to grant permissions for.


Solution 1:

What you did is right but first you may have to change the group to "devs" with the chgrp or chown command. Note that in unixland a file only has one group.

Solution 2:

You're probably looking for chown or chgrp

Solution 3:

You can specify the group of the file using the chgrp command.

Solution 4:

First thing to do is:

chown -R <user>:devs docs

then:

chmod -R 070 docs

That will give rwx to the group of docs and no permissions to the rest, if you want the owner to have the same permissions then do:

chmod -R 770 docs