Directory Permissions The chmod command can also be used to control the access permissions for directories.
Suppose you have a project where a number of people require access to a file. In case the file is an ordinary file, read permission allows the user to open the file and examine its contents. Generally not a desirable setting.
Unix uses the value stored in a variable called umask to decide the default permissions. All users belonging to a group will have the same access permissions to the file.
To find out the mode of a directory: ls -dl dir This person has neither created the file, nor he belongs to a usergroup who could own the file. This means that any user who changes into that directory suddenly performs all actions as if the owners group was their default group.
You must be the owner of the file or directory to perform a chgrp.