ls -l
或是 ll
來查看第一個值
去除掉最一開頭的 d,分為三組值
- r: readable
- w: writable
- x: executable
- -: 表示無權限
而分三組為
- owner 的權限
- member in group 的權限
- others 的權限
Number | Description |
---|---|
7 (111) |
read, write, and execute |
6 (110) |
read and write |
5 (101) |
read and execute |
4 (100) |
read only |
3 (011) |
write and execute |
2 (010) |
write only |
1 (001) |
execute only |
0 (000) |
no permission |
- in nodejs
- For example, the octal value
0o765
means:
- The owner may read, write and execute the file.
- The group may read and write the file.
- Others may read and execute the file.
chmod
\[ugoa...\]\[\[+-=\]\[rwxX\]...\]\[,...\]
-R
目錄下所有檔案皆做相同權限操作chown