The meaning of permissions (R, W, x) in Linux for directories and files
First, the significance of the permissions for the directory
1, the first thing to understand is that the main content of the directory is to record the list of file names and sub-directories, rather than the place where the data is actually stored.
2. R permissions: Having this permission means that the list of directory structures can be read, that is, you can view the file name and subdirectory name under the directory, note: only the name.
3, W permissions: Having this permission means having permission to change the directory structure list, in short, the W permission of the directory is related to the change of the file name or subdirectory name in the directory, note: refers to the name. Specific as follows:
1) Create a new file or subdirectory under this directory.
2) Delete a file or subdirectory that already exists in the directory (regardless of the permissions for that file or subdirectory), note: It is important that the user can delete a file or directory to see if the user has the W permission to the directory where the file or directory resides.
3) Rename the file or subdirectory that already exists in the directory.
4) Transfer the location of the files or subdirectories within the directory.
4, x permissions: The x permission to have a directory indicates that the user can enter the directory into a working directory, can enter a directory, only with the directory's X permission, if the user does not have x permission for a directory, you cannot switch to the directory, you cannot execute any command under that directory, even if the directory has R permissions. And if the user does not have X permission on a directory, the user cannot query the contents of the file under that directory, note: Refers to the content, if you have R permission to view the list of file names or subdirectories in the directory. So to open the directory to anyone browsing, should at least give R and X permission.
Second, the significance of the permissions for the file
1, it should also be understood that the file is actually contained in the data, so R, W, x permissions on the file is related to its content.
2. R permissions: For this permission, the actual contents of this file can be read.
3, W permissions: Having this permission means that you can edit, add, or modify the contents of the file. However, the deletion of the file is not included because the above permission is for the purpose of the directory to know what the conditions for deleting the file or directory are.
4, x Permission: Indicates that the file has permissions that can be executed by the system. Whether a file can be executed is determined by that permission, and does not have an absolute relationship with the file name.
The meaning of permissions (R, W, x) in Linux for directories and files