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

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


Preface

1. In the previous section, we talked about some basic permission bits of files under Linux, mainly introduced the 3 part permission bits of files, and what their corresponding rwx means. If you haven’t read it, please click on the link below to enter: Basic file permissions ( Forgot to say, the previous section only talked about the meaning of the permission bits of normal files. The permission bits of directory files are somewhat different from those of files)

2. Then I left two points in the last section, that is, the "-" in the first position of the permission bit of the file and the "." in the last position. I have not said yet, this section will talk about these two things.


Tip: The following is the content of this article

1. The basic file permissions (-)

1. As we said in the previous section, the rwx in the middle three parts respectively represent the permissions of a certain file, r=readable, w=writable, and x=executable.

2. Then we have left two points, one is what the previous "-" is, and the other is the last "."

3. Then let's start with the first "-". As we said in the previous section, one of the middle three parts of permission bits, such as owner permission, if your owner does not have a certain permission, its position will be drawn The last "-" (For example, if you are the file owner, and your permission is only rw, then the permission bit of your owner should be rw-, because you have no execution permission, so "-" is used to indicate that you do not have this permission)
Insert picture description here

4. So let’s not talk too much nonsense . The area where the "-" of our first permission bit is called the file type bit . The content of this position is to determine whether the file with this permission is a directory or a normal file..., then Let me introduce the main types (common) {

4.1: "-": The "-" in this position does not mean the same as the middle permission position. The middle "-" means that the file does not have this permission, and the "-" appears here, which means your file is a normal file (That is, as long as "-" appears in your location, it proves that it is just an ordinary file. The permission bits mentioned yesterday can be used for ordinary files. The directory is a little different. The following are some ordinary files
Insert picture description here

4.2: "d": If d appears in your first area, it means that this is a directory file (everything under Linux is a file, so a directory is also a file), the blue one below is a directory file
Insert picture description here

4.3: "l": It means this is a soft link file , the one with -> below is a soft link file
Insert picture description here

4.4: "b": It means this is a block device file, and the storage device is usually this type of file (for example, your partition /dev/sda1 is this type of file)
Insert picture description here

4.5: "c": It means that this is a character device file, and the input device is usually this (mouse and keyboard)
Insert picture description here
4.6: "p": This means that this is a pipe character file , a very rare special device file
Insert picture description here
4.7: " s": This means this is a socket file and also a special device file
Insert picture description here

}

2. File permission bit (.)

The last point "." of the file permission bit is actually impossible to talk about now. That point actually means that SElinux is enabled in your file system (that is, if SElinux is enabled in your file system, you will bring this point every time you create a file. , If you turn off the file creation, there will be no dots), as follows, I turned off SElinux, and the file permission bit of jieshu was created without dots – SElinux will say later
Insert picture description here


to sum up

This section can be regarded as a supplement to some of the remaining knowledge of the file permission bits in the previous section. In this section we describe {the first position of the file permission bit: the file type bit, the last "." of the file permission bit: whether SElinux is enabled or not }


In the next section, we will talk about the permissions of the directory. I am Jiehua. See you next time.

Guess you like

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