chmod [options] file(s)
Permission start with letter specifying which users should be affected by change:
u owner user
g owner group
o other (neither u nor g)
a all users
Followed by a change instruction:
+ set
- clear
Every mode has a corresponding number:
r read 4
w write 2
x execute 1
Shorthand for changing entire permisson follows (u, g, o) triplet with sum of mode corresponding to permission. For example:
chmod 755 sample.txt
means in triplet
u+rwx rwx
g+rx-w r-x
o+rx-w r-x