(>) Redirection output symbol
Usage: Command> file name
Feature: overwrite (when the input and output files are the same file, the file content is cleared; not suitable for continuous redirection)
Typical applications:
~ $ Cat a B> c (merge files)
~ $ Echo "hello world"> hello.txt (input content to the specified file)
~ $./Test. sh>/dev/null (delete program input)
(>>) Output redirection
Usage: Command> file name
Feature: append
Typical applications:
~ $ Cat hello.txt> hello2.txt
~ $./Test. sh> test. echo
(2>) Error redirection
Usage: Command 2> file name
Feature: Overwrite
Typical applications:
~ $./Test. sh> test. error
(2>) Error redirection output symbol
Usage: Command 2> file name
Feature: append error messages
Typical applications:
~ $./Test. sh 2> test. error
(|) MPs queue symbol
Usage: command 1 | command 2
Feature: the previous command output serves as the input of the next command.
Typical applications:
~ $ Ps-ef | grep root
(*) Match any character
(? ) Match any character
(&) Run commands in the background (Daemon)
Usage: command 1 &
Feature: Close the current terminal window and the program is still running
Typical applications:
~ $./Test. sh &
(&) Connect multiple commands
Usage: command 1 & command 2
Feature: If command 1 is successfully executed, continue to execute command 2; otherwise, do not execute command 2.
Typical applications:
~ $ Apt-get update & apt-get dist-upgrade
(|) Logical or
Usage: command 1 | command 2
Feature: If command 1 is successfully executed, command 2 is not executed; otherwise, command 2 is executed.
(!) Non-logical
Feature: exclude a specified range.
([X-y]) specified range
(#) Comment
("") Double quotation marks
Feature: The content contained in it is a common character, except ''\ $.
('') Single quotes
Feature: Use the content contained in it as a common character without exception.
('') Inverted quotation marks
Feature: Execute the content it contains
(\) Escape characters
Usage; \ symbol
Feature: remove the specific meaning of a symbol to make it a common punctuation.
($) Variable call symbol
Usage: $ variable
Feature: call a variable to obtain the value of the Variable
(;) Command Separator
Usage: command 1; command 2
Feature: execute commands sequentially in one line of statements.
() Overall execution
({}) Variable Separation
From mr_yqs