When we need to execute multiple commands at once, the commands need to be connected with a connector, and different connectors have different effects.
(1); A semicolon that has no logical relationship to the connector. When multiple commands are concatenated with semicolons, the success or failure of each command has no effect on each other, and is executed one at a time.
(2) | | Logical OR, when you connect multiple commands with this connector, the previous command executes successfully, and subsequent commands do not. The previous command execution failed and subsequent commands will not execute.
(3) && logic and when you connect multiple commands with this connector, the previous command executes successfully before the command executes, the previous command fails, and the following command does not execute, with the | | Just the opposite.
(4) | Pipe character, when you connect multiple commands with this connector, the correct output from the previous command is given to the subsequent command to continue processing. If the previous command failed, it will be an error, if the following command can not process the output of the preceding command, will also error.
[Go]linux Order execution of multiple commands