Linux如何更改文件及文件夹权限(How does Linux change files and folder permissions)
Linux如何更改文件及文件夹权限(How does Linux change files and folder permissions)
How does Linux change file and folder permissions? That's a good question. The setting of Linux file permissions is another highlight of the Linux operating system, which makes the Linux operating system more secure. Here's a detailed overview of how Linux changes file and folder permissions.
Let's first take a look at the file properties, enter in the shell environment: LS -l, you can view the current directory file. Such as:
Drwxr-xr-x 2, NSF users 102412-10, download the file backup at 17:37
Corresponding to:
File property, connection number, file owner, group file size, file modification time, file name
Here is R W readable, writable, X executable file attributes, which is divided into four sections, - 10 positions
Such as:
D RWX R-X R-X
The first character specifies the file type. In a common sense, a directory is also a file. If the first character is a horizontal line, it means that it is a non directory file. If it is D, it means a directory.
The second paragraph is the property of the file owner,
The third paragraph is the attribute of the file owned group,
The fourth paragraph is the property for other users,
If the above folder "access the download file backup" folder, said "download file backup" is a directory file folder; "download file backup" is the main read and write executable permissions; read and execute permission only and folder "download file backup" is the main group of users with other users; read and execute permissions.
After determining the access rights of a file, the user can use the Chmod command provided by the Linux system to reset the different access rights. You can also use the chown command to change the owner of a file or directory. A user group that changes a file or directory using the chgrp command.
Chmod command
Function: the Chmod command is very important for changing access to files or directories. Users use it to control access to files or directories