(& Gt;) redirection output symbol usage: Command & gt; 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 :~ $ Catab & gt; c (merge files )~ Descriecho"helloworld">hello.txt...
(>) 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