Ubuntu Chmod Command: Change File Permissions
The chmod command is used to change the permissions of a file or directory. Its basic syntax is:
chmod [选项] 模式 文件或目录
Common options include:
- -R: Recursively change the permissions of a file or directory.
- -v: Display detailed information about the modifications.
- Display only files whose permissions have been modified.
The permissions can be represented in numerical form or symbol form. Numerical permissions are as follows:
- No permission
- 1: Execution rights
- 2: Writing permission
- 4: Read access
Different combinations of these numbers can be used to represent various levels of access. For example, 777 represents all permissions being fully open.
Symbolic forms of authority include:
- u: owner of the file or directory
- Group ownership of a file or directory
- o: other users
- a: All users
In addition, you can use “+”, “-“, and “=” to indicate increasing, decreasing, or setting permissions. For example, chmod +x file means giving the file “file” the permission to execute.
In short, the chmod command allows users to flexibly modify the permission settings of files or directories as needed.