Many new users make mistakes (or have misunderstanding) while applying chmod
on files or directories, because of a lack of informative knowledge of:
- Symbolic notation for
ugo
andrwx
- Use of octal numbers
So, in this answer I have provided some useful information that can help to understand correct symbolic notation and using octal numbers.
Informative knowledge is provided with the help of The Linux Command-line as reference/source.
First of all it is very essential to know about
ugo
andrwx
manner:rwx
rwx
rwx
Understanding of attribute which can be out put by
ls-l
:-rwx------
-rw-------
-rw-r--r--
-rwxr-xr-x
-rw-rw----
lrwxrwxrwx
drwxrwx---
drwxr-x---
Applying Permission:
u
g
o
a
u
”, “g
”, and “o
”.u+x
u-x
+x
o-rw
go=rw
u+x,go=rx
Using Octal number:
0
000
---
1
001
--x
2
010
-w-
3
011
-wx
4
100
r--
5
101
r-x
6
110
rw-
7
111
rwx
Hence the following work the same:
And
You can download pdf version of The Linux Command-line book from Sourceforge.