Numeric permissions in linux along with chmod allows you to easily change/modify read, write and execute permissions in user, group, others.
Numeric or Octal file permissions in Linux using chmod command
![]() |
Chmod command |
Hello, guys welcome to the next session on Linux command line tutorial. In the last two sessions, we have discussed how we can use symbolic permissions in Linux.
Now in this session, we will discuss octal or numerical permissions with the files in Linux.
So let's get started,
First of all, What is octal permission?
Octal permission is a numerical representation of the file permission.
So let me just change the directory to desktop/
![]() |
Example |
And then I list the permissions of this file.
When I do this I can see the permissions and this we have seen in the last session.
![]() |
permissions |
- First three things are for the users.
- Next three are for the groups.
- Other three are for everyone.
Numerical permissions
So let me simplify the normal numerical or octal permissions using this concept.
let's say this is our user, group and others.
user group others
r w x r w x r w x
These three users, group and other. Each has read, write and execute permissions.
Now octal representation can be done by using binary notations.
user group others
r w x r w x r w x
1 1 1 1 1 1 1 1 1
Change user permission on Linux
If you want to provide the permission for a file for the "user".
For example, I give "users" all the three permissions read, write and execute.
user
r w x
1 1 1
4 2 1
So let's start from Right side so I just say 1, 2 and 4.
In binary, you can double the value, when you go left.
When you add these three numbers. The addition will be "4+2+1=7".
If you want to allow the "user" to read, write and execute a file then you need to give the number notation "7".
![]() |
Modify user permission |
$chmod 700 fileName
If you want don't want to give the permission then do it "0".
Change group permission
I just want to give the "group" only to read and execute permission.
group
r w x
1 0 1
4 0 1
So I will just do write (w) equal to zero.
What will be the numerical notation for this we will start from the right-hand side.
So the value is "1" because we want the execute permission the next value will be "0" because we don't want the write permission and the next value will be "4" because we want the read permission.
And the addition of these value will be "4+1=5".
So whenever you want to give the only read and execute permission then you just need to give the numerical notation of "5".
![]() |
Modify group permission |
$chmod 050 fileName
Reference Table
I have a Table for these Notations,
r, w, x permissions | Binary | Octal |
---|---|---|
--- | 000 | 0 |
--x | 001 | 1 |
-w- | 010 | 2 |
-wx | 011 | 3 |
r-- | 100 | 4 |
r-x | 101 | 5 |
rw- | 110 | 6 |
rwx | 111 | 7 |
So this is a simple table and this is how we can calculate these value.
You can calculate all the values using this approach.
Conclusion
So this is how you can use octal or numerical permissions in Linux.
I hope you've enjoyed this tutorial please rate comment and bye for now.
HAVE A NICE DAY💕