Directory and File Permissions

Source: Internet
Author: User

Importance of permissions on files

Files are the places where data is actually contained, including common text files, database content files, binary executable files (Binary Program) and so on. Therefore, permission is of the following significance for a file:

1. R (read): Read the actual content of the file, such as the text content of the text file;

2. W (write): You can edit, add, or modify the content of the file (but not delete the file );

3. X (excute): this file has the permission to be executed by the system (in Linux, whether our file can be executed depends on whether it has the "X" permission, but there is no absolute relationship with the file name ).

 

Importance of permissions on directories

A file stores the actual data. The main content of a directory is the list of recorded file names, which are strongly correlated with directories. Therefore, permission is of the following significance for a file:

1. R (read contents in directory): indicates that you have the permission to read the list of directory structures. Therefore, when you have the permission to read (r) a directory, you can query the file name data in this directory, so you can use the LS command to display the content list of this directory.

2. W (modify contents of directory): This writable permission is very powerful for the directory. Because it indicates that you have the permission to change the directory structure list, that is, the following permissions:

(1) Create new files and directories;

(2) Delete existing files and directories (regardless of the permissions of the files );

(3) Rename an existing file or directory;

(4) Transfer the files and directories in the directory.

In short, the W permission of the directory is related to the change in the file name under the directory.

3. X (Access Directory): What is the purpose of directory execution permission? The directory is just a record file name. It cannot be used for execution? The directory cannot be executed,Directory X indicates whether the user can access the directory.To become a working directory, the so-called working directory is your current directory. Distance means that when you log on to Linux, your main folder is your current working directory. The command to change the directory is "cd" (Change directory ).

 

Directory and 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.