‘chmod’ — For Linux/Unix users
Published in
1 min readSep 28, 2016
‘chmod’ command is used to change permissions of a file/directory by Linux/Unix users.
This command can be used in 2 different forms.
1. Symbolic permission notation
chmod who=permissions filename
‘who’ refers to :
u: user who owns the file , g : group that file belongs to , o: other users ,
a: all the above
‘permissions’ refers to:
r: read , w: write , x: execute
So, an example ‘chmod’ command to give,
- read,write and execute permissions to a user
- read and execute permissions to the group
- read permissions to other users
will be as follows.
chmod u=rwx,g=rx,o=r myfile
2. Octal permission notation
chmod octal-number filename
The ‘octal-number’ above is the representation of permissions in a numerical manner.
When taking user, group, other from the representation in the symbolic notation and considering the same example,
u : r w x : 111 : 7
g : r — x : 101: 5
o : r — — :100:4
chmod 754 myfile
References: