Skip to content

Commit

Permalink
doc: update command/mkdir.md (#585)
Browse files Browse the repository at this point in the history
添加:-m 参数权限
  • Loading branch information
nsnans authored Jun 27, 2024
1 parent 770ae32 commit c5c2179
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions command/mkdir.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,27 @@ mkdir -m 700 /usr/meng/test
mkdir -p-m 750 bin/os_1
```

### 补充

-m :配置文件的权限

如:755

每个数字代表不同的权限集合,分别为:

- 第一个数字`7`:所有者(user)的权限
- 第二个数字`5`:所属组(group)的权限
- 第三个数字`5`:其他用户(others)的权限

每个数字是以下权限的组合:
- 读权限 (read) - 4
- 写权限 (write) - 2
- 执行权限 (execute) - 1

因此,`755`的具体权限为:

- `7`(所有者)= 4 (读) + 2 (写) + 1 (执行) = 7
- `5`(所属组)= 4 (读) + 1 (执行) = 5
- `5`(其他用户)= 4 (读) + 1 (执行) = 5


0 comments on commit c5c2179

Please sign in to comment.