0

I created a directory and the next step is to make that directory part of a group. Is this down with chown? Or another command? This is for my schoolwork. We have gone over permissions and changing file ownership and modigying users. Chown & chmod. But I cant find anything in my notes about making a directory part of a group. What am i missing?

Would i use chown -R group-name directory name/pathway

The very next questions is changing permissions of "others" which i know how to do.

  • 1
    When you looked at chown did you also look at chgrp? If not, I would suggest you do so. – roaima Dec 4 '19 at 20:02
  • ok so thank you. chgrp group-name directory name would be it? – BIsco Dec 4 '19 at 20:12
  • or should it be recursive? – BIsco Dec 4 '19 at 20:17
  • I got it. Thank you – BIsco Dec 4 '19 at 20:39
0

The way that UNIX operates, everything is a file, including directories. As such, directories can have their user and group changed using chown just like folders.

To change just the top level directory.

chown :groupname directory

To change the directory and all the sub-files and sub-directories.

chown -R :groupname directory

If you have any other questions about chown, I would recommend checking out the chown man page or taking a look at this askUbuntu answer.

0

Each directory (or file) has owner, group and permissions.

You cannot "make directory part of a group", but you can change directory (or file) group ownership.

The command to change group ownership is chgrp:

chgrp <group> <directory-or-file-name>

The command chown also can be used to change a directory (or file) group membership, where group name is specified together or without owner name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.