Title: Permissions (rwx)
Course: CIS 121: Linux/UNIX I: Fundamentals ~ For IGNITE Review > Section: Learning Modules

The nine characters following the file type denote the permissions in three triplets. A permission can be r for read access, w for write access, and x for execute.

- You need the r permission to list (ls) the contents of a directory.
- You need the x permission to enter (cd) a directory.
- You need the w and x permissions to create files in or remove files from a directory.

Three Sets of rwx

We already know that the output of ls -l starts with ten characters for each file. The below example shows a regular file because the first character is a dash (-) .

paul@RHELv4u4:~/test$ ls -l proc42.bash

-rwxr-xr-- 1 paul proj 984 Feb 6 12:01 proc42.bash

Below is a table describing the function of all ten characters in the above example (-rwxr-xr--).

When you are the user owner of a file, then the user owner permissions apply to you. The rest of the permissions have no influence on your access to the file.

When you belong to the group that is the group assignment of a file, then the group assigned permissions apply to you. The rest of the permissions have no influence on your access to the file.

When you are not the user owner of a file and you do not belong to the group assigned, then the others permissions apply to you. The rest of the permissions have no influence on your access to the file.

To summarise:

- The first rwx triplet represents the permissions for the user owner.
- The second triplet corresponds to the group assignment; it specifies permissions for all members of that group.
- The third triplet defines permissions for all other users that are not the user owner and are not a member of the group.

(Source: Linux Fundamentals, Cobbaut, 217-218)

Enrichment Activities:

Watch the video Linux File Permissions (Time: 13:29)