Back to DevOps Series
Understanding the Permission String:

Understanding the Permission String:

The permission string contains 10 positions (characters).
Example:
Loading...
Let's count:
Loading...

Position 1 = File Type

The first position tells us the file type.
Examples:
Symbol
Meaning
-
Regular File
d
Directory
l
Link
Example:
Loading...
Here :
Loading...
means it is a regular file.

Remaining 9 Positions = Permissions

After the first character, the remaining 9 positions represent permissions.
Example:
Loading...
These 9 positions are divided into 3 groups:
Loading...
Each group contains 3 positions.

Three Permission Groups

Loading...

User (Owner)

The owner of the file.
Loading...

Group

Users belonging to the same group.
Loading...

Others

Everyone else.
Loading...

Structure of Each Group

Every permission group always follows the same order:
Loading...
Position
Meaning
1st
Read
2nd
Write
3rd
Execute
This order never changes.

Permission Symbols

Symbol
Meaning
r
Read
w
Write
x
Execute
-
Permission Not Granted

 
 

Example 1

Loading...
Meaning:
Loading...

Example 2

Loading...
Meaning:
Loading...

Example 3

Loading...
Meaning:
Loading...

Complete Breakdown Example

Loading...
Break it as:
Loading...
 
 
 
 


 

Three Permission Types

Every file and directory has three basic permissions:
notion image
Permission
Symbol
Number
Meaning
Read
r
4
View content
Write
w
2
Modify content
Execute
x
1
Run file/program
Let's understand each one.

Read Permission (r)

Allows viewing file contents.
Example:
Loading...
If you have read permission, you can open and read the file.
Permission:
Loading...
The owner can read the file.

Write Permission (w)

Allows modifying a file.
Examples:
Loading...
Loading...
Without write permission:
Loading...

Execute Permission (x)

Allows running a file as a program.
Example script:
Loading...
File:
Loading...
Run:
Loading...
If execute permission is missing:
Loading...
Add execute permission:
Loading...
Now:
Loading...
works.