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

王林
Release: 2019-12-26 15:10:32
Original
7873 people have browsed it

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
Copy after login

&&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: 未找到命令
Copy after login

||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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!