The difference between the Linux directory file permissions.

Source: Internet
Author: User

    • The importance of permissions to files
    • R (Read): Can read the actual contents of this file, such as reading the text file content, etc.;

Because there is no permission to W, so come in and have readonly message.

    • W (write): You can edit, add, or modify the contents of the file (without deleting the file);
    • X (Execute): The file has permissions that can be executed by the system.

    • The importance of permissions to the directory
    • R (Read contents in directory):

      Represents a permission to read a list of directory structures, so when you have read (r) permissions for a directory, you can query the file name data under that directory. So you can use the LS command to display the table of contents of this directory! This directory must have the permission of x before it can enter this directory.
       
      Example: The permissions for a directory are as follows: drwxr--r--  3  root  root   08:35   test system has an account name of ZYX2, This account does not support the root group, what permissions does zyx2 have on this directory? Can I switch to this directory? A: Zyx2 has only R permissions on this directory, so vbird can query the list of file names under this directory. Because ZYX2 does not have X permissions, ZYX2 cannot switch to this directory! (Pretty important concept!) )

      Can not enter a directory, only with the directory of the X permission related! In addition, the working directory is very important for the execution of instructions, if you do not have X permission in a directory, then you cannot switch to that directory, you will not be able to execute any instructions under that directory, even if you have the permissions of the directory R.

    • W (Modify contents of directory):

      This writable permission is great for the directory! because he says you have permissions to move the directory structure list, which is the permissions below:

      • Creation of new documents and directories;
      • Delete files and directories that already exist, regardless of the permissions of the file! )
      • Renaming a file or directory that already exists;
      • Move the files and directory locations within the directory.

      In summary, the directory's W permissions are related to the file name changes under the directory.

    • X (Access directory):

      Hey! What is the use of directory execution permissions? The directory is just a record file name, you can not carry it? That's right! The directory cannot be executed, and the x of the directory represents the user's ability to enter the directory as a working directory! The so-called working directory is the directory where you are now! For example, when you log in to Linux, your home directory is your current working directory. The instructions for changing the directory are "CD" (Change directory)!

The difference between the Linux directory file permissions.

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.