File and Directory Permissions
Last updated
Last updated
Understanding read, write and executable permissions.
If we do ls -l
:
Here as we can see a dot "." at the head part of the output line shows that this is a regular file.
When going through permissions there are four parts of it which can be seen in form of drwx-rw-r--
.
r --> Read permission w --> Write permission x --> Executing permission "-" --> No permission
Directory
d
Regular File
- , .
Character File
c
Link
l
Socker File
s
Pipe
p
Block Device
b
When a user tries to read or write to a file, the users permisisons are evaluated in a linear left to right manner:
First owner permissions will be looked at and action will be taken based on its permissions.
If the owner has none of the required permissions then group permissions will be looked at and action is taken accordingly.
Lastly if the user is not int he group or does not exist then last set of permissions will be looked at and action is taken accordingly.