<permission> 9 <owner> <group> <size> Nov 12 20:37 .
$ ls -l
-rw-r--r-- 1 root root 3 Jun 29 15:35 a.log
drwxr-xr-x 2 root root 2 Jun 30 18:06 dir
d rwx r-x r-x
┬ ─┬─ ─┬─ ─┬─
│ │ │ │
│ │ │ └─ 4. Other|5 (4+0+1)
│ │ └────── 3. Group|5 (4+0+1)
│ └─────────── 2. User |7 (4+2+1)
└─────────────── 1. File Type | d = directory | l = link
Permission |
Description |
Octal |
Decimal |
--- |
No Permission |
000 |
0 (0+0+0) |
--x |
Execute |
001 |
1 (0+0+1) |
-w- |
Write |
010 |
2 (0+2+0) |
-wx |
Execute and Write |
011 |
3 (0+2+1) |
r-- |
Read |
100 |
4 (4+0+0) |
r-x |
Read and Execute |
101 |
5 (4+0+1) |
rw- |
Read and Write |
110 |
6 (4+2+0) |
rwx |
Read, Write and Execute |
111 |
7 (4+2+1) |
$ chmod [options] <permissions> <file>
$ chmod 755 foo.txt
$ chmod +x data.py
$ chmod u-x data.py
$ chmod u=rwx,g=rx,o= quickref.sh
$ chmod -R 755 my_directory