The meaning of directory and file permissions in Linux
The meaning of file permission
R: You can read the specific contents of this document;
W: You can edit the contents of this file, including adding the details of the deleted file;
X: The file has executable permissions-------Note: Here and window is not the same, in win, the file executable permissions are expressed through the extension, such as EXE, BAT, etc., but in Linux file executable permission is determined by this x, and file name does not matter.
Second, the meaning of directory permissions
R: You can view the full file list information in this directory.
W: You can make related changes to all the files and directories in this directory, that is, you can change the list of structures in this directory (this should be taken into consideration) specific rights as follows:
You can create a new file or directory under this directory;
You can delete a file or directory that exists in this directory, regardless of the permissions of the file, and pay extra attention to!!!! )
You can rename and change the location of the file or directory.
X: The directory does not have executable permissions, so the function of x in the directory is to allow other users to enter the directory.
cloud-dwelling communities remind people of the need Note the point:
The problem here is that sometimes when we want to share a file with someone else (the same group, or other), you change the permissions of the file, the other person is still unable to see, because the other people can not enter your user home directory, the default does not have X permissions. If at this point you open X permission to allow him to see the file, someone will enter the directory to view the file or modify the file. If this person thinks the file is good, want to CP A, then he does not have permission to the directory default is not W permission, here we should pay special attention to: it is best not to directly open the W permission, because so that others can change the list of this directory at will (including delete, delete is very dangerous). So we can have this file CP a copy, put in a third party directory with W permission, the other side also from here CP, so our home directory will not be affected by any.
Here is a funny example, a system administrator has built an important. txt file, in order to prevent others to the file, the administrator set permissions for the-rex------, this administrator think it is foolproof, put this file casually put a directory, I thought that even if other people see this file can not do anything, but if this directory has the rights of W, although others can not do anything to this file, but he has the right to delete the file, this is fatal.
Here is a description of the Linux permissions for the file and the meaning of the directory
The meaning of the permission to the file:
R: You can read the actual contents of this file.
W: You can edit, add, or modify the contents of the file (but not delete the file), if there is no R permission, cannot w.
X: The file has permissions that are executed by the system. can be deleted.
permissions to the directory;
R:read contents in directory. Represents a permission to read a list of directory structures.
W:modify contents in directory. Represents a permission that has a list of changes to the directory structure. such as: New file and directory, delete existing files and directories (regardless of the permissions of the file), the existing files or directories to rename, transfer the directory of files, directory location
X:access directory. The directory's X represents the user's ability to access the directory called the working directory.
The above is described in this article to the Linux file permissions directory permissions on the meaning and permissions on the meaning of the file directory, I hope this article to share the help.