> For the complete documentation index, see [llms.txt](https://termux-wiki.zsxwz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://termux-wiki.zsxwz.com/untitled/wen-jian-quan-xian.md).

# 文件权限

Linux系统上对文件的权限有着严格的控制，用于如果相对某个文件执行某种操作，必须具有对应的权限方可执行成功，一些配置如ssh的配置文件夹只能是600.

Linux下文件的权限类型一般包括读，写，执行。对应字母为 r、w、x

权限： r=4，w=2，x=1

```
rwx = 4 + 2 + 1 = 7

rw = 4 + 2 = 6

rx = 4 +1 = 5
```

可以使用chmod设置文件权限：

```
# 可执行权限。
# 不能设置/sdcard文件夹里的文件可执行权限
chmod +x file

# 运行可执行权限文件
./file

# 设置拥有者可读写，其他人不可读写执行
chmod 600 file
```

termux如果没有root权限也不能修改其他权限，就不介绍了。
