Latest Blogs

Files & Directory Permissions in Linux – A Detailed Explanation

Permission is important feature exist in operating system. Every file or folder could be accessed by assigning the permission to specific user or group. Without any single permission we can’t access any file or any directories.

What kind of permissions exists in Operating System?

There are basically three types of permission are exists read, write and execute.

Every operating system consists of permission concept and required to assign to users. In Linux, there are two types of permission exists:

i)                    Alphabetic Permissions

ii)                  Number Permissions

permission in linux

Where alphabetic permissions represents show the alphabetic permission such as read, write and execute.

 

read write execute

                                                                                             
You can see the figure here described the alphabetic permission concept. We clearly seen that regular file name represent “-“and then it start permission on different level and directory show initialized with “d”. It belongs to three type of permission level u+g+o i.e. user level permission, group level permission and other user permission. Alphabetic permission works on u+g+o.

Apart from this, further information like primary owner, primary group, size and access time with file name information.

 

How to assign Alphabetic Permissions

User Level Permission

In user level permission, you just simply call the chmod command. You can see the syntax first.

# chmod u+r <file name>

Or

# chmod u+r <directory name>

Group Level Permission

# chmod g+rw <file name>

Or

# chmod u+rw <directory name>

Other User Level Permission

# chmod o+x <file name>

Or

# chmod o+x <directory name>

 

How to Remove Permission

#chmod u-r <file name>

Press enter to proceed.


ll command

 Now it is time discuss another type of permission i.e. numeric permission in linux operating system.

As discussed earlier, there are three type of permissions exists.

numeric permission

We have three permission section user, group and other user. To use numeric we can just simply call numeric to add or remove permissions. 

How we can implement the numeric permission

 

User Level Permission

In user level permission, you just simply call the chmod command. You can see the syntax first.

# chmod 700 <file name>

Or

# chmod 700 <directory name>

Where 7 is full permission for user level, group and other user exist 0 means “null” permission to access the file.

Group Level Permission

# chmod 060 <file name>

Or

# chmod 060 <directory name>

Where 6 (read (4) and write (2) = 6 (read and write) is mentioned permission for group level, user and other user exist 0 means “null” permission to access the file.

 

Other User Level Permission

# chmod 701 <file name>

Or

# chmod 701 <directory name>

In other user permission, full permission is given to user level. Other user gave only execute permission.

How to Remove Permission

#chmod 700 <file name>

Press enter to proceed.

You can simply call or reduce the number according remove the permission on specific file and directories in operating system.


chmod permission


So, it is all about permission. I think now, it is clear the concept.

In this blog, we are mainly aim to understand the basic permission exists in operating system. There are two types of operating system permission exists alphabetic and numeric permission. With their own working and implement strategy, we implement each and every aspects discussed about the permission concept. Effective and understandable permission concept is necessary to implement. We clearly mentioned all permission levels and how we can apply on our terminal application. For more information, you can send us query.     


No comments