0

For some reason, there isn't "staff" user group on a folder that I just created.

I would like the to add/permit "staff" user group to read and write in this folder.

How do I add/permit "staff" to this folder?

I'm new to all this unix command so not really sure. But this post, seems to suggest to type this in terminal:

sudo chgrp -R staff ./folderName
  1. Is the "./folderName" a relative path? Meaning for example if the folder is right under desktop and my current directory is desktop, that command should do it right? or does the path need to be absolute?"
  2. What does the "-R" do? Because I seen other post that doesnt use the "-R"? Is it necessary?

I'm asking this to make sure that I'm doing the correct thing before I stuffed up. I'm totally new to all this, kindly please be patient and guide me.

1
  • this, seems to suggest that "-R" makes it recursive. What does recursive mean? Does it meant that all the subsequent subfolder underneath "./folderName" also got added staff?
    – Hadi Amrat
    Commented Jun 24, 2022 at 3:20

1 Answer 1

0

That command should do what you expect/want.

Comments:

  • You may well not need the sudo.
  • The ./folderName is a relative path, as you surmised. But in this case you don't need the ./.
  • The -R is recursive - i.e. it will change the group for all files within the hierarchy under folderName. If you just want to change the folderName then you don't want this.
  • You could add a -v (or even -vv) which will list all the files as they are changed.

So I would first use chgrp -vv staff folderName or chgrp -R -vv staff folderName depending whether you want to change the whole hierarchy under folderName.

You can get the detail on any Terminal command using the man program. For example man chgrp.

Be careful if there are any symbolic links, aliases, etc. in the folder.

Make sure of your backup before using new terminal commands - just in case!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .