File Permissions
File permissions in Linux determine who can read, write, or execute a file or directory. Understanding these permissions is essential for managing system security and functionality.
By executing the ls -l
command, a list of details from a file or directory will be displayed. The first part represents the permissions associated with the file. It looks like a combination of symbols -
and letters d
r
c
w
s
. These can be understood as follows:
First indicates the type of file: Not special (
-
), directory (d
)Then, we find three sections of three letters, each one indicating: owner, group, and other
Each letter indicates the permissions: read (
r
), write (w
), or execute (x
) for the respective section
The permissions can also be represented by adding the numbers in each section where
r=4
,w=2
andx=1
Special permissions
Two classes of special permission known as SUID (Set User ID) and SGID (Set Group ID) allow running specific applications as the root user for certain users or groups without being owners.
The letter
s
indicates SIUD or SGID permissions
Also, we can find an extra permission for directories known as Sticky bit, that ensures that only the owner of the file/directory, or the root user can delete or rename files within the directory.
The letters
t
represents the Sticky bit but users still have execution permissionsIf shown capitalized (
T
) all other users do not have access permissions contents to the folder
Last updated
Was this helpful?