20201010 lesson 3, pipe character, redirection, environment variables and Vim

Standard input redirection (STDIN, file descriptor is 0): Input from the keyboard by default, or input from other files or commands.
Standard output redirection (STDOUT, file descriptor is 1): The default output is to the screen.
Error output redirection (STDERR, file descriptor 2): The default output is to the screen.

The function of the pipe command symbol is summarized in one sentence: "The information originally output to the screen of the previous command is regarded as the standard input of the next command".

The 4 most commonly used escape characters are shown below.
Backslash (\): Make a variable after the backslash a simple character.
Single quotation mark (''): escape all variables in it as simple strings.
Double quotation marks (""): Keep the variable attributes in it, without escaping.
Backquote (``): Return the result after executing the command.

The command execution in Linux is divided into four steps:
Step 1: Determine whether the user enters the command (such as /bin/ls) in an absolute path or a relative path, and execute it directly if it is.
Step 2: The Linux system checks whether the command entered by the user is an "alias command", that is, replace the original command name with a custom command name.
Step 3: The Bash interpreter determines whether the user entered an internal command or an external command. Internal commands are instructions inside the interpreter and will be executed directly; and the user inputs external commands most of the time, and these commands are handed over to step 4 to continue processing.
Step 4: The system searches for the command file entered by the user in multiple paths, and the variable that defines these paths is called PATH, which can be simply understood as a "little assistant of the interpreter", which tells the Bash interpreter to wait The location where the executed command may be stored, and then the Bash interpreter will obediently look it up in these locations one by one. PATH is a variable composed of multiple path values. Each path value is separated by a colon. The addition and deletion of these paths will affect the search of Linux commands by the Bash interpreter.

20201010 lesson 3, pipe character, redirection, environment variables and Vim

Command mode: Control cursor movement, copy, paste, delete and search text.
Input mode: normal text input.
Last line mode: save or exit the document, and set the editing environment.

20201010 lesson 3, pipe character, redirection, environment variables and Vim

Guess you like

Origin blog.51cto.com/14951072/2541091