Home  >  Article  >  Operation and Maintenance  >  How to execute multiple commands at the same time in the linux command line

How to execute multiple commands at the same time in the linux command line

王林
王林Original
2019-12-26 15:10:327740browse

How to execute multiple commands at the same time in the linux command line

; Separated by a semicolon, it means that the command must be executed regardless of whether it is successfully executed or not. Separated by

[root@localhost /]# date;date;date
2019年 05月 03日 星期五 09:08:37 CST
2019年 05月 03日 星期五 09:08:37 CST
2019年 05月 03日 星期五 09:08:37 CST

&& symbols, it means that the commands are executed in sequence. If one of them fails, the execution will exit, similar to break in a loop.

Free video tutorial sharing: linux video tutorial

[root@localhost /]# date&& data&&date
2019年 05月 03日 星期五 09:09:03 CST
-bash: data: 未找到命令

|| symbols are separated, indicating that the commands are executed in sequence, as long as one of them is executed successfully, Exit execution.

[root@localhost /]# date||date||date
2019年 05月 03日 星期五 09:09:24 CST
[root@localhost /]# data||date||ls
-bash: data: 未找到命令
2019年 05月 03日 星期五 09:09:42 CST

More related articles and tutorials are recommended: linux tutorial

The above is the detailed content of How to execute multiple commands at the same time in the linux command line. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn