Home >Operation and Maintenance >Linux Operation and Maintenance >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!