Linux self-study journey-basic commands (directory permissions)

Linux self-study journey-basic commands (directory permissions)


Preface

1. In the previous section, we officially finished the file permission bit; in the file permission bit, we mainly introduced a complete file permission divided into three parts, and how to check the type of the file. If it is not clear, please click the link below to watch:
File permission bit 1
File permission bit 2

2. In this section we continue to talk about basic permissions, but this section starts with the permission bits of directory files. In fact, the syntax format of directory file permission bits is the same as that of file permission bits, but the semantics are different.


Tip: The following is the content of this article

1. Directory permissions

1. Directory permissions are also divided into three parts

[root@localhost ceshi]# mkdir mk
[root@localhost ceshi]# ls -lh
总用量 0
-rw-r--r--. 1 root root 0 1月  23 15:07 a[0-3].php
drwxr-xr-x. 2 root root 6 1月  23 15:20 mk
[root@localhost ceshi]# 

1. As above, we see the mk file. I can see from the first d of the first field information displayed in its long format that it is a directory file. The latter is actually the three parts of our basic permissions, which are the same as file permissions. They are the permissions corresponding to the owner, the group they belong to, and other people; so it’s easy to understand here that the directory file and the file have the same permissions for three parts, that is, their syntax is the same, just say the inside rwx may correspond to inconsistent meanings. (That is to say, the directory also has the three parts of owner, group, and others. For example, the permission rwx in the owner may not mean the same as rwx in the file.)

2. rwx in the catalog file

1. We know that r=read (whether the content in the file can be viewed), w=write (whether the content can be written to the file), x=execute (equivalent to the exe execution program in windows, representing Is the file executable)

2. The rwx of our catalog file is slightly different from the rwx of the file, so in our catalog file
{

1. "r" = represents whether you can view the contents of the directory (for example, if you do not have r permissions in the permissions of other people in this directory file, then now someone else has come, and he entered your directory. You cannot view the contents of your directory with ls)

2. "w" = represents whether it is possible to modify or delete other files or directories in the directory (for example, if there is no w in the permissions of other people in your directory, then now someone else comes in Your directory, if he wants to modify some files in your directory, he cannot modify it, and of course he cannot delete it)

3. "x" = whether you can enter the directory (that is, if you don't have x permission, then you cannot use cd to enter this directory)

}


to sum up

Then our directory permissions are also finished. In this section, we have talked about
{ 1. The three parts of directory permissions 2. The rwx in directory permissions }


So let's talk about some permissions commands in the next section. I'm Jiehua. See you next time.

Guess you like

Origin blog.csdn.net/qq313088385/article/details/113050362
Recommended