|
|
@@ -0,0 +1,433 @@ |
|
|
|
# 1. OS标准库简介 |
|
|
|
|
|
|
|
顾名思义,OS表示Operating System,即操作系统。OS标准库是一个操作系统接口模块,提供一些方便使用操作系统相关功能的函数,具体安装位置可通过导入os模块查看`os.__file__`属性得到。当需要在Python代码中调用OS相关功能实现业务逻辑或者无法直接使用命令行工具时,我们就需要考虑导入此模块,因此有必要进行深入学习。 |
|
|
|
|
|
|
|
# 2. OS标准库常用函数和属性 |
|
|
|
|
|
|
|
## 2.1 文件和目录 |
|
|
|
|
|
|
|
### 2.1.1 `os.getcwd()` |
|
|
|
|
|
|
|
返回表示当前工作目录的字符串 |
|
|
|
|
|
|
|
```python |
|
|
|
print("当前工作目录为:{}".format(os.getcwd())) # 返回当前工作目录 |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.getcwd.JPG) |
|
|
|
|
|
|
|
### 2.1.2 `os.mkdir(path, mode=0o777, *, dir_fd=None)` |
|
|
|
|
|
|
|
以指定数字表示的权限模式mode创建一个名为path的目录。某些系统会忽略 mode,如果没有忽略,那么Linux系统来说,新建文件夹的权限=指定数字表示的权限模式mode-当前系统用户的umask默认权限,如下所示 |
|
|
|
|
|
|
|
```python |
|
|
|
""" |
|
|
|
Linux操作系统可通过umask命令获得4个八进制数表示的默认权限,root用户默认是0022,普通用户默认是 0002 |
|
|
|
第1位数代表文件所具有的特殊权限(SetUID、SetGID、Sticky BIT),后3位数表示表示umask权限值 |
|
|
|
分别对应所有者、用户组、其他人的权限值,权限与数字对应关系为:r->4,w->2,x->1 |
|
|
|
""" |
|
|
|
exit_code=os.system("umask") |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/umask.JPG) |
|
|
|
|
|
|
|
```python |
|
|
|
""" |
|
|
|
文件夹模式mode赋值为十进制511,等价于八进制0o777 |
|
|
|
""" |
|
|
|
set_mode=511 |
|
|
|
os.mkdir(path="./cyr",mode=set_mode) # 在当前目录创建名为cyr的文件夹 |
|
|
|
``` |
|
|
|
|
|
|
|
```python |
|
|
|
# 长格式查看新创建的文件夹cyr可知其权限字符串为rwxr-xr-x,等价于转换后的数字权限111101101 |
|
|
|
!ls -l | grep cyr |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/新建文件夹cyr权限.JPG) |
|
|
|
|
|
|
|
```python |
|
|
|
umask_value=0o0022 # 当前系统用户八进制表示umask默认权限 |
|
|
|
new_dir_mode=set_mode-umask_value |
|
|
|
print("新建文件夹的权限为:{:b}".format(new_dir_mode)) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/新建文件夹cyr权限验证.JPG) |
|
|
|
|
|
|
|
+ `os.rmdir(path, *, dir_fd=None)` |
|
|
|
|
|
|
|
移除(删除)目录 *path*。如果目录不存在或不为空,则会分别抛出 [`FileNotFoundError`](https://docs.python.org/zh-cn/3.7/library/exceptions.html#FileNotFoundError) 或 [`OSError`](https://docs.python.org/zh-cn/3.7/library/exceptions.html#OSError) 异常。 |
|
|
|
|
|
|
|
```python |
|
|
|
os.rmdir("./cyr") # 删除空文件夹成功,无法查到cyr目录 |
|
|
|
!ls | grep cyr |
|
|
|
``` |
|
|
|
|
|
|
|
```python |
|
|
|
os.rmdir("./why") # 删除不存在的文件夹FileNotFoundError报错 |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/删除不存在文件夹报错.JPG) |
|
|
|
|
|
|
|
```python |
|
|
|
os.rmdir("./nnunet/") # 删除不为空文件夹OSError报错 |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/删除不为空文件夹OSError报错.JPG) |
|
|
|
|
|
|
|
+ `os.chdir(path)` |
|
|
|
|
|
|
|
将当前工作目录更改为 path |
|
|
|
|
|
|
|
```python |
|
|
|
print("切换前的当前工作目录为:{}".format(os.getcwd())) # 返回当前工作目录 |
|
|
|
dst_path="/root" # 目标文件夹 |
|
|
|
os.chdir(dst_path) # 将当前工作目录切换为/root |
|
|
|
print("切换后的当前工作目录为:{}".format(os.getcwd())) # 返回当前工作目录 |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.chdir.JPG) |
|
|
|
|
|
|
|
+ `os.listdir(path='.')` |
|
|
|
|
|
|
|
返回一个包含指定path下所有文件和目录名称的按任意顺序排列的列表,特殊条目'.'和'..'除外 |
|
|
|
|
|
|
|
```python |
|
|
|
dst_path="/code/" # 目标目录 |
|
|
|
dirs_ls=os.listdir(path=dst_path) # 获得指定目录下全部文件和文件夹名称列表 |
|
|
|
print(dirs_ls) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.listdir.JPG) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 2.2 os.path常见路径操作 |
|
|
|
|
|
|
|
### 2.2.1 `os.path.abspath(path)` |
|
|
|
|
|
|
|
返回路径path 的绝对路径(标准化的),相当于字符串拼接,路径path不存在也不会报错 |
|
|
|
|
|
|
|
```python |
|
|
|
relative_path="tests/test_steps_for_sliding_window_prediction.py" # 路径path存在 |
|
|
|
print("{}对应的绝对路径为{}".format(relative_path,os.path.abspath(relative_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.path.abspath.JPG) |
|
|
|
|
|
|
|
```python |
|
|
|
no_path="tests/none.py" # 路径path不存在 |
|
|
|
print("{}对应的绝对路径为{}".format(relative_path,os.path.abspath(no_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.path.abspathno.JPG) |
|
|
|
|
|
|
|
### 2.2.2 `os.path.basename(path)` |
|
|
|
|
|
|
|
返回路径 path 的基本名称 |
|
|
|
|
|
|
|
```python |
|
|
|
full_pathname="/proc/bus/pci/3a/08.0" # 路径path存在 |
|
|
|
print("全路径名称对应的文件名为{}".format(os.path.basename(full_pathname))) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.path.basename.JPG) |
|
|
|
|
|
|
|
```python |
|
|
|
no_full_pathname="/demo/none.cpp" # 路径path不存在 |
|
|
|
print("全路径名称对应的文件名为{}".format(os.path.basename(no_full_pathname))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221126180414744](Python标准库之os.assets/image-20221126180414744.png) |
|
|
|
|
|
|
|
### 2.2.3 `os.path.dirname(path)` |
|
|
|
|
|
|
|
返回路径 path 的目录名称 |
|
|
|
|
|
|
|
```python |
|
|
|
full_pathname="/proc/bus/pci/3a/08.0" # 路径path存在 |
|
|
|
print("全路径名称对应的目录名称为{}".format(os.path.dirname(full_pathname))) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.path.dirname.JPG) |
|
|
|
|
|
|
|
```python |
|
|
|
no_full_pathname="/demo/none.cpp" # 路径path不存在 |
|
|
|
print("全路径名称对应的目录名称为{}".format(os.path.dirname(no_full_pathname))) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.path.dirnameno.JPG) |
|
|
|
|
|
|
|
### 2.2.4 `os.path.exists(path)` |
|
|
|
|
|
|
|
判断path是否指向一个已存在路径或已打开的文件描述符,存在返回True,不存在返回False |
|
|
|
|
|
|
|
```python |
|
|
|
full_pathname="/proc/bus/pci/3a/08.0" # 路径path存在 |
|
|
|
print("全路径名称对应的目录是否存在?{}".format(os.path.exists(full_pathname))) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.path.exists.JPG) |
|
|
|
|
|
|
|
```python |
|
|
|
no_full_pathname="/demo/none.cpp" # 路径path不存在 |
|
|
|
print("全路径名称对应的目录是否存在?{}".format(os.path.exists(no_full_pathname))) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.path.existsno.JPG) |
|
|
|
|
|
|
|
### 2.2.5 `os.path.isabs(path)` |
|
|
|
|
|
|
|
判断path是否为一个绝对路径,是则返回True,不是或不存在则返回False。在 Unix 上,它就是以斜杠开头,而在 Windows 上,它可以是去掉驱动器号后以斜杠(或反斜杠)开头。 |
|
|
|
|
|
|
|
```python |
|
|
|
abs_pathname="/proc/bus/pci/3a/08.0" # 路径path存在 |
|
|
|
print("全路径名称对应的目录是否为绝对路径?{}".format(os.path.isabs(abs_pathname))) |
|
|
|
``` |
|
|
|
![image-20221126193214609](Python标准库之os.assets/image-20221126193214609.png) |
|
|
|
```python |
|
|
|
rel_pathname="./nnunet/__init__.py" # 路径path是相对路径 |
|
|
|
print("全路径名称对应的目录是否绝对路径?{}".format(os.path.isabs(rel_pathname))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221126193232255](Python标准库之os.assets/image-20221126193232255.png) |
|
|
|
|
|
|
|
```python |
|
|
|
no_pathname="./nnunet/none.py" # 路径path是不存在 |
|
|
|
print("全路径名称对应的目录是否绝对路径?{}".format(os.path.isabs(no_pathname))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221126193244714](Python标准库之os.assets/image-20221126193244714.png) |
|
|
|
|
|
|
|
### 2.2.6 `os.path.isfile(path)` |
|
|
|
|
|
|
|
若path为指向一个已存在文件的符号链接或一个已存在文件路径,返回True。若path为一个文件夹路径或不存在路径,返回False。 |
|
|
|
|
|
|
|
```shell |
|
|
|
ls -li /opt/conda/bin/python* # 带inode节点信息并长格式查看python开头的文件和文件夹 |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/ls_li.JPG) |
|
|
|
|
|
|
|
由上图可发现/opt/conda/bin/python为一个符号链接(软链接)指向一个已存在文件路径/opt/conda/bin/python3.7 |
|
|
|
|
|
|
|
```python |
|
|
|
abs_pathname="/opt/conda/bin/python3.7" # path为一个已存在文件路径 |
|
|
|
print("全路径名称对应的文件是否存在?{}".format(os.path.isfile(abs_pathname))) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.path.isfiletrue.JPG) |
|
|
|
|
|
|
|
```python |
|
|
|
symbolic_link="/opt/conda/bin/python" # path为指向一个已存在文件/opt/conda/bin/python3.7的符号链接 |
|
|
|
print("全路径名称对应的文件是否存在?{}".format(os.path.isfile(symbolic_link))) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.path.isfiletrue-16695128425931.JPG) |
|
|
|
|
|
|
|
```python |
|
|
|
abs_path="/opt/conda/bin/" # 文件夹路径 |
|
|
|
print("全路径名称对应的文件是否存在?{}".format(os.path.isfile(abs_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127093432253](Python标准库之os.assets/image-20221127093432253.png) |
|
|
|
|
|
|
|
```python |
|
|
|
no_full_pathname="/demo/none.cpp" # 路径path不存在 |
|
|
|
print("全路径名称对应的文件是否存在?{}".format(os.path.isfile(no_full_pathname))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127093502677](Python标准库之os.assets/image-20221127093502677.png) |
|
|
|
|
|
|
|
### 2.2.7 `os.path.isdir(path)` |
|
|
|
|
|
|
|
若path为指向一个已存在文件夹的符号链接或一个已存在文件夹路径,返回True。若path为一个文件路径或不存在路径,返回False。 |
|
|
|
|
|
|
|
```shell |
|
|
|
ls /code/nnunet/ # 查看已存在文件夹路径/code/nnunet/ |
|
|
|
``` |
|
|
|
![image-20221127110800609](Python标准库之os.assets/image-20221127110800609.png) |
|
|
|
|
|
|
|
```shell |
|
|
|
ln -s /code/nnunet/ ./symlink2codennunet # 当前目录即root下创建一个软链接指向一个已存在文件夹路径/code/nnunet/ |
|
|
|
``` |
|
|
|
|
|
|
|
```shell |
|
|
|
ls -l /root/ |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127110142399](Python标准库之os.assets/image-20221127110142399.png) |
|
|
|
|
|
|
|
由上图可知root用户主目录下存在一个软链接symlink2codennunet指向一个已存在文件夹路径 |
|
|
|
|
|
|
|
```python |
|
|
|
exist_dir_path="/code/nnunet/"# path为一个已存在文件夹路径 |
|
|
|
print("全路径名称对应的文件夹是否存在?{}".format(os.path.isdir(exist_dir_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127111107995](Python标准库之os.assets/image-20221127111107995.png) |
|
|
|
|
|
|
|
```python |
|
|
|
exist_dir_symlink="/root/symlink2codennunet/"# path为指向一个已存在文件夹的符号链接 |
|
|
|
print("全路径名称对应的文件夹是否存在?{}".format(os.path.isdir(exist_dir_symlink))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127111131025](Python标准库之os.assets/image-20221127111131025.png) |
|
|
|
|
|
|
|
```python |
|
|
|
exist_file_path="/opt/conda/bin/python3.7"# path为一个已存在文件路径 |
|
|
|
print("全路径名称对应的文件夹是否存在?{}".format(os.path.isdir(exist_file_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127111201285](Python标准库之os.assets/image-20221127111201285.png) |
|
|
|
|
|
|
|
```python |
|
|
|
no_path="/demo/none.cpp" # 路径path不存在 |
|
|
|
print("全路径名称对应的文件夹是否存在?{}".format(os.path.isdir(no_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127111218903](Python标准库之os.assets/image-20221127111218903.png) |
|
|
|
|
|
|
|
### 2.2.8 `os.path.islink(path)` |
|
|
|
|
|
|
|
若path代表一个已存在的符号链接,则返回True,反之则返回False。如果 Python 运行时不支持符号链接,则总是返回 False |
|
|
|
|
|
|
|
```python |
|
|
|
exist_symbolic_link="/opt/conda/bin/python" # path为指向一个已存在的符号链接 |
|
|
|
print("全路径名称对应的符号链接是否存在?{}".format(os.path.islink(exist_symbolic_link))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127135410586](Python标准库之os.assets/image-20221127135410586.png) |
|
|
|
|
|
|
|
```python |
|
|
|
no_symbolic_link="/demo/no_link" # path为指向一个不存在的符号链接 |
|
|
|
print("全路径名称对应的符号链接是否存在?{}".format(os.path.islink(no_symbolic_link))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127135440128](Python标准库之os.assets/image-20221127135440128.png) |
|
|
|
|
|
|
|
```python |
|
|
|
exist_file_path="/opt/conda/bin/python3.7"# path为一个已存在文件路径 |
|
|
|
print("全路径名称对应的符号链接是否存在?{}".format(os.path.islink(exist_file_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127135526214](Python标准库之os.assets/image-20221127135526214.png) |
|
|
|
|
|
|
|
```python |
|
|
|
exist_dir_path="/root/"# path为一个已存在文件夹路径 |
|
|
|
print("全路径名称对应的符号链接是否存在?{}".format(os.path.islink(exist_dir_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127135543707](Python标准库之os.assets/image-20221127135543707.png) |
|
|
|
|
|
|
|
### 2.2.9 `os.path.join(path, *paths)` |
|
|
|
|
|
|
|
拼接两个或多个路径部分,按需要插入`/`。如果参数中某个部分是绝对路径,则绝对路径前的路径都将被丢弃,并从绝对路径部分开始连接。如果最后一部分为空,则结果将以分隔符结尾。 |
|
|
|
|
|
|
|
```python |
|
|
|
previous_path,abs_dirname,basename,empty_part="model","/code","demo.py","" |
|
|
|
``` |
|
|
|
|
|
|
|
```python |
|
|
|
print("参数中某个部分是绝对路径拼接后为{}".format(os.path.join(previous_path,abs_dirname,basename))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127141227036](Python标准库之os.assets/image-20221127141227036.png) |
|
|
|
|
|
|
|
```python |
|
|
|
print("拼接两个或多个路径部分,按需要插入'/'拼接后为{}".format(os.path.join(previous_path,basename))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127141254552](Python标准库之os.assets/image-20221127141254552.png) |
|
|
|
|
|
|
|
```python |
|
|
|
print("最后一部分为空以分隔符结尾{}".format(os.path.join(previous_path,basename,empty_part))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127141326629](Python标准库之os.assets/image-20221127141326629.png) |
|
|
|
|
|
|
|
### 2.2.10 `os.path.normcase(path)` |
|
|
|
|
|
|
|
规范路径名称的大小写。 在 Windows 上,将路径名称中的所有字符转为小写,并将正斜杠转为反斜杠。 在其他操作系统上,将路径不加修改地返回。 |
|
|
|
|
|
|
|
Linux操作系统 |
|
|
|
|
|
|
|
```python |
|
|
|
print("当前操作系统模块名为:{}".format(os.name)) |
|
|
|
windows_style_path=r"C:/Users\defaultuser0/APPData" |
|
|
|
print("Windows路径规范化后为{}".format(os.path.normcase(windows_style_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127142558417](Python标准库之os.assets/image-20221127142558417.png) |
|
|
|
|
|
|
|
Windows操作系统 |
|
|
|
|
|
|
|
![image-20221127143000287](Python标准库之os.assets/image-20221127143000287.png) |
|
|
|
|
|
|
|
### 2.2.11 `os.path.split(path)` |
|
|
|
|
|
|
|
将路径 path 拆分为一对,即 (head, tail),其中,tail 是路径的最后一部分,而 head 里是除最后部分外的所有内容。tail 部分不会包含斜杠,如果 path 以斜杠结尾,则 tail 将为空。如果 path 中没有斜杠,head 将为空。如果 path 为空,则 head 和 tail 均为空。head 末尾的斜杠会被去掉,除非它是根目录(即它仅包含一个或多个斜杠)。 |
|
|
|
|
|
|
|
```python |
|
|
|
norm_path="/nnunet/configuration.py" # 一般路径 |
|
|
|
ends_with_slash_path="/code/nnunet/" # 以斜杠结尾的路径 |
|
|
|
no_slash_path="HIP_Logo.png" # 没有斜杠的路径 |
|
|
|
empty_path="" # 空路径 |
|
|
|
root_path="/" # 根目录 |
|
|
|
print("一般路径head={},tail={}".format(*os.path.split(norm_path))) |
|
|
|
print("以斜杠结尾的路径head={},tail={}".format(*os.path.split(ends_with_slash_path))) |
|
|
|
print("没有斜杠的路径head={},tail={}".format(*os.path.split(no_slash_path))) |
|
|
|
print("空路径head={},tail={}".format(*os.path.split(empty_path))) |
|
|
|
print("根目录head={},tail={}".format(*os.path.split(root_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127152957405](Python标准库之os.assets/image-20221127152957405.png) |
|
|
|
|
|
|
|
### 2.2.12 `os.path.splitext(path)` |
|
|
|
|
|
|
|
将路径 path 拆分为一对,即 (root, ext),使 root + ext == path,其中 ext 为空或以英文句点开头,且最多包含一个句点。路径前的句点将被忽略,例如 splitext('.cshrc') 返回 ('.cshrc', '')。 |
|
|
|
|
|
|
|
```python |
|
|
|
dir_path="/code/nnunet/" # 文件夹路径 |
|
|
|
multi_dot_file_path="/code/i.thy.py" # 包含多个句点的文件路径 |
|
|
|
single_dot_file_path="/code/we.py" # 包含单个句点的文件路径 |
|
|
|
starts_with_dot_file_path=".bashrc" # 以句点开头的路径 |
|
|
|
print("文件夹路径root={},ext={}".format(*os.path.splitext(dir_path))) |
|
|
|
print("包含多个句点的文件路径root={},ext={}".format(*os.path.splitext(multi_dot_file_path))) |
|
|
|
print("包含单个句点的文件路径root={},ext={}".format(*os.path.splitext(single_dot_file_path))) |
|
|
|
print("以句点开头的路径root={},ext={}".format(*os.path.splitext(starts_with_dot_file_path))) |
|
|
|
``` |
|
|
|
|
|
|
|
![image-20221127153824033](Python标准库之os.assets/image-20221127153824033.png) |
|
|
|
|
|
|
|
|
|
|
|
## 2.3 其他常用命令 |
|
|
|
|
|
|
|
### 2.3.1 `os.name` |
|
|
|
|
|
|
|
导入的依赖特定操作系统的模块的名称,返回'posix'表示Linux,'nt'表示Windows,'java'表示Java虚拟机 |
|
|
|
|
|
|
|
```python |
|
|
|
print("当前操作系统平台名称为{}".format(os.name)) |
|
|
|
``` |
|
|
|
|
|
|
|
![](../img/os.posix.JPG) |
|
|
|
|
|
|
|
### 2.3.2 `os.__file__` |
|
|
|
|
|
|
|
以字符串形式返回os模块安装的绝对路径 |
|
|
|
|
|
|
|
```python |
|
|
|
import os |
|
|
|
print("os模块安装绝对路径是{}".format(os.__file__)) |
|
|
|
``` |
|
|
|
|
|
|
|
![](Python标准库之os.assets/os.__file__演示.JPG) |
|
|
|
|
|
|
|
|
|
|
|
# 3. 参考文献 |
|
|
|
|
|
|
|
+ [os --- 操作系统接口模块 — Python 3.7.13 文档](https://docs.python.org/zh-cn/3.7/library/os.html) |
|
|
|
+ [os.path --- 常见路径操作 — Python 3.7.13 文档](https://docs.python.org/zh-cn/3.7/library/os.path.html) |
|
|
|
+ [Linux umask详解:令新建文件和目录拥有默认权限 (biancheng.net)](http://c.biancheng.net/view/764.html) |
|
|
|
+ [Linux chmod命令:修改文件或目录的权限 (biancheng.net)](http://c.biancheng.net/view/755.html) |