0
-rw-rw---- 2 alice project 4096 Dec 6 13:12 new

If I am right, Alice can read and write, but so can everyone else that is part of the group, right? I have a hard time understanding when a file has group permission. With the user, it is simple and other users as well, but groups I can't seem to get it. Like is the folder "project" the one who gets the permission or everyone else that is inside the folder ?

Paulo Tomé
  • 3,782
zellez11
  • 149

2 Answers2

1

You are confusing a few things:

Directories (sometimes called folders, though this is not the best metaphor), are where where files and directories are kept.

Files and directories have permissions rwx owning user and group.

The group permission affects everyone in the group (except the owning user). So in your example there is a file named new it can be read and written be user alice, and all other users in the group named project.

If we have another file.

 -r--rw---- 2 alice project 4096 Dec 6 13:12 another

This file named another can be read by alice, and read and written by everyone else in the group (alice can not write, even if in the group). However as alice is the owning user, she can also change the permissions on the file. Permission to change the permission, is always held by the owning user (alice).

muru
  • 72,889
  • Thanks for clearing that out for me was a but confused, but now I get it – zellez11 Dec 11 '19 at 20:42
  • follow up question if any other user wanted to delete a file but they are not the user but they are part of the group can they do that or not ? – zellez11 Dec 11 '19 at 21:24
  • New questions should be in a new question: However permission to delete a file, is with the containing directory. If you have write permission (of a directory) then you can create, move, rename, delete files (including directories). (extended ACLs add a specific delete permission, but this is a future feature. see also https://unix.stackexchange.com/q/101263/4778) – ctrl-alt-delor Dec 11 '19 at 21:30
0

Your understanding is correct, the owner and any member of the group will have read and write access to the file/folder that has those permissions. Here's an additional resource for ease of understanding