chmod 777 numeric file permission in linux | Pro Tech guides

chmod 777 numeric file permission in linux

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 777 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/
Numeric permissions
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.


Permission in linux
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".

Change user permission in linux
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 using chmod command
Modify group permission

$chmod 050 fileName

Reference Table

I have a Table for these Notations,
r, w, x permissionsBinaryOctal
---0000
--x0011
-w-0102
-wx0113
r--1004
r-x1015
rw-1106
rwx1117
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💕

Name

Apps,3,Games,1,Linux,38,Linux Commands,37,Network-Devices,1,Networking,1,Terminal Apps,2,Termux,17,Userland,3,Windows,1,
ltr
item
Pro Tech guides: chmod 777 numeric file permission in linux
chmod 777 numeric file permission in linux
Numeric permissions in linux along with chmod allows you to easily change/modify read, write and execute permissions in user, group, others.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhibXGrbtPelbaKBDvJXmZSuIabziwhqvUrikz2LTKbebKNcAV6ZgK-UzFzl2kDUoY82pTOv-_zHFsPdonlavINdQAnXCDa8P5KmjSbrTSVb-GrtvwENeFw6IiPm0znSj75-_5r0clD0cc/s16000/numerical-Permissions.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhibXGrbtPelbaKBDvJXmZSuIabziwhqvUrikz2LTKbebKNcAV6ZgK-UzFzl2kDUoY82pTOv-_zHFsPdonlavINdQAnXCDa8P5KmjSbrTSVb-GrtvwENeFw6IiPm0znSj75-_5r0clD0cc/s72-c/numerical-Permissions.jpg
Pro Tech guides
https://devops-digest.blogspot.com/2021/01/chmod-777-numeric-file-permission-in-linux.html
https://devops-digest.blogspot.com/
https://devops-digest.blogspot.com/
https://devops-digest.blogspot.com/2021/01/chmod-777-numeric-file-permission-in-linux.html
true
7053638852026728047
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content