Drwxr-x --- 46 Jibo 4096 _ SRC
They correspond:
File Attribute connection count file owner group file size file modification time file name
Here, R is readable, W writable, and X executable. The file attributes are divided into four sections, ---- --- 10 positions.
For example:
D rwx R-x r-x
The first character specifies the file type. In general, a directory is also a file. If the first character is a horizontal line, it indicates a non-directory file. If it is D, it indicates a directory.
The second part is the attributes of the file owner,
The third section is the attributes of the group to which the file belongs,
The fourth section is the attributes of other users.
You can use the CHMOD command provided by Linux to reset different access permissions. You can also use the CHOWN command to change the owner of a file or directory. Use the chgrp command to change the user group of a file or directory.
CHOWN command
Function: Modify the owner and group of a file or directory. This command is also very common. For example, if the root user copies a file to Xu, the root user should set the owner of the file to Xu to allow Xu to access the file. Otherwise, user Xu cannot access this file.
Syntax: chown [Option] user or group file
Note: chown will change the owner of a specified file to a specified user or group. Users can be user names or user IDs. A group can be a group name or group ID. Files are separated by spaces to change the permission list. Wildcards are supported.
Parameters:
-R recursively changes the owner of all subdirectories and files under a specified directory.
-V: displays the work done by the CHOWN command.
Example 1: Change the owner of the Shiyan. c file to Wang.
$ Chown Wang Shiyan. c
Example 2: Change the owner of the directory/his and all files and subdirectories to Wang and the group to users.
$ Chown-r Wang. Users/his