Linux Background Knowledge:
(1) von Neumann System:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/80/04/wKioL1c0dlvw8uH_AAFj1Nr6XWs393.png "alt=" Wkiol1c0dlvw8uh_aafj1nr6xws393.png "/>
Note: ① Memory refers to ram.
② CPU The data read is from memory, CPU The processed data must be written back to memory before it is passed from memory to the input unit.
( 2 ) Environment Variables
Multi-user means that each user logs into the system and has its own dedicated environment, which is defined by a set of variables called environment variables. Environment Variables are closely related to the shell and can be set through shell commands.
( Shell: Shell, a bridge connecting user commands and operating systems, can be dispatched to allow child processes to execute commands. )
Linux environment variables that are common in:
① PATH: Specify the search path for the command echo $PATH
② HOME: Specify the user's main working directory
③ histsize: refers to the number of records in which the history command was saved.
④ LOGNAME: refers to the login name of the current user.
⑤ HOSTNAME: refers to the name of the host
⑥ SHELL: to the current user what kind of Shell .
⑦ Lang/languge: and language-related environment variables, users in multiple languages can modify this environment variable.
⑧ MAIL: to the current user's mail storage directory.
⑨ PS1: command basic prompt, for Root User is # , for ordinary users is $ .
⑩ PS2: secondary prompt, default is " > ".
Note: The names of the above variables are not fixed, as HOSTNAME in some Linux the system may be set to HOST
Linux also provides commands to modify and view environment variables! Here are some examples to illustrate:
① Echo Show an environment variable value Echo $PATH
② Export to set a new environment variable Export
hello= "HELLO" (can be without quotation marks)
③ Env Show all environment variables
④ Set Displays the locally defined Shell variables
⑤ unset Clear Environment Variables
⑥ ReadOnly Setting the system environment variable readonly HELLO
( 3 ) Linux File Type
<1> Normal Type: The first character is a [ - ]
include: ① Plain Text documents: Linux the largest type of file in the system, with data that we can read directly, such as numbers, letters, and so on. ② binaries: This is the format of executable files in Linux. ③ data Format files: Some programs will read some files in a particular format during the run.
<2> Table of Contents: The first character is [d]
<3> Connection file: The first character is a [L]
<4> equipment and equipment files
block device files, that is, some storage files, such as hard disks, floppy disks, etc., the first character is [b]
A character device file, which is an interface file for some serial ports, such as a keyboard, mouse, etc., the first character is [C]
<5> Sockets The first character is [s]
Also known as data interface files, this type of file is usually used for data connections on the network. We can start a program to listen to the client's request, and the client can communicate through the data interface file.
<6> Piping The first character is [P]
FIFO is also a special type of file, the main purpose is to solve the error caused by multiple programs accessing a file at the same time.
( 4 ) Linux the extension
Basically, Linux The file does not have the so-called extension, a Linux file can be executed, with x about and has no relation to the file name. Under Linux , as long as you have x in your permission , for example [-rwx-r-xr-x], That means the file can be executed. But being able to perform is different from being able to perform successfully.
. SH: script or batch file
. Z. Tar. tar.gz. zip. tgz: Packaged Compressed Files
. html. PHP: Web-related documents
(5) Linux Shell instruction Operation Principle
Linuxstrictly speaking is an operating system, which we call "the core (Kernel) ", but we general users, cannot directly useKernel. But byKernelThe "Shell" program, which is calledShellcome withKernelcommunication.
technically speaking, Shell The simplest definition of: command-line interpreter
Mainly include:
(1) Translating the user's name into core processing
(2) at the same time, translate the core processing result to a user
shell for linux The main thing is to parse our instructions, Parse instruction to linux kernel. The result of the feedback is run through the kernel, through the Shell parsing to the user.
How does the shell run the program?
ShellwithForkCreate a new process withExecvThe function family runs the user-specified program in the new process, and finallyShellwithwaitThe command waits for the new process to end. waitThe system call also takes the exit State or signal sequence from the kernel to tell the subroutine how to end it.
( 6 ) Linux Manage Permissions
<1> categories of File visitors
a) owner of file and file directory: u---User
b) user of the group that owns the file and file directory: g---Group
c) Other users: o---Others
<2> Types of File access permissions
a) Basic Permissions
i. Read (R/4) : Read for a file, have permission to read the contents of the file, and for the directory to have permission to browse the directory information
II. Write (W/2) : Write for a file, has the right to modify the contents of the file, and for the directory to delete files within the Mobile directory permissions
III. Execution (X/1) : Execute for a file, you have permission to execute the file, and for the directory, you have permission to enter the directory.
iv. "-" means that the item does not have permission .
such as: [Drwxr-xr-x] D-----> Catalogue Three three separate representations: Owner (rwx)--- group (r-x)--- others (r-x)
Where the owner has the ability to read and write executable, the group has the readable and non-writable executable permission, and the other has the readable non-writable executable permission.
This article from the "Chase" blog, reproduced please contact the author!
First knowledge of Linux