View This Site In Your Own Language

chmod : to change permission

Go through the below image:

Suppose, you have a directory with some files. Open this directory into terminal and type "ls -l"


here, "cubic_resume.png" file's permissions are: rwx | rw- | rwx
  • owner/user : rwx    i.e. read, write and execute permission
  • group : rw-    i.e. read and write permission
  • other/everyone : rwx    i.e. read, write and execute permission

chmod to change permission :

  • chmod [OPTION] MODE[,MODE] Filename
  • chmod [OPTION] OCTAL-MODE Filename
See the example below...

 To change read, write and execute permission through octal value

  • owner/user : rwx    i.e. 4+2+1 = 7
  • group : rwx    i.e. 4+2+1 = 7
  • other/everyone : rwx    i.e. 4+2+1 = 7

To remove read/write/execute permission from all users through symbolic value

u : user
g : group
o : other
a : all
+ : adding
- : removing
= : assigning

a-x means removing execute permission from all

To add no permission for all through octal value

To add:

  • read, write and execute permission to user/owner
  • read and write permission to group
  • read permission to other/everyone

u+rwx, g+rw, o+r means adding read, write and execute permission to user/owner; adding read and write permission to group; adding read permission to other




If you face any problems to understand, please feel free to comment.
Happy Learning!
chmod : to change permission chmod : to change permission Reviewed by Ikram on 6/27/2020 10:57:00 AM Rating: 5

1 comment:

Powered by Blogger.