The meaning of permissions (R, W, x) in Linux for directories and files

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.