Remember that in the previous introduction of the C H o d command, the permissions bits and files of the directory are different. Now let's take a look at the difference. The Read permission bit for a directory means that the contents can be listed. The Write permission bit means that you can create files in this directory, and you can cancel the corresponding write permission bits if you do not want other users to create files in your directory. Executing a permission bit means searching for and accessing the directory (see table 1-5, Table 1-6).
If you set the permissions of the same group of users or other users to a directory--X, they will not be able to list the files in that directory. If the directory has a script or program that executes a location bit, it can still be executed as long as the user knows its path and file name. The user's ability not to enter the directory does not hinder his execution.
Permissions on the directory will overwrite the permissions of the files in that directory. For example, if directory d o C S has the following permissions:
And the permissions for the file p a Y are:
The user of a D m i n group will not be able to edit the file because the directory it belongs to does not have such permissions.
The file is readable to any user, but because the directory in which it resides does not give execute permissions to users of the A D m i n group, users of that group will not be able to access the directory, and they will get an "Access restricted" error message.
Directory of Linux Systems explained