mozillazg's Blog
  • Feed
  • About
  • Archives

[linux]bash 下 ; && || 的区别

2013-09-28

linux Tags linux / bash / shell
  • 参考¶

linux 中 bash 下执行多个命令时,; && || 操作符的区别:

cmd1 ; cmd2 cmd1 和 cmd2 都会 被执行
cmd1 && cmd2 如果 cmd1 执行 成功 则执行 cmd2
cmd1 || cmd2 如果 cmd1 执行 失败 则执行 cmd2

参考¶

  • linux - what is the difference between "command && command" and "command ; command" - Super User

微信扫一扫:分享

Scan me!

微信里点“发现”,扫一下

二维码便可将本文分享至朋友圈。

有任何建议和想法欢迎在下方评论区留言或者加我微信交流

Related Posts:

  • Bash Shell 常用语法和操作
  • Python: linux 环境下如何修改 PIPE buffer size
  • [linux] 修复 Redmine 无法发送通知邮件,提示 550 5.7.1 Unable to relay 的问题
  • [linux]配置 vsftp 启用被动模式(passive mode)解决客户端"no route to host"错误
  • [linux]修复 gcc 编译时的出现的 "CPU you selected does not support x86-64 instruction set" 错误

Comments


© 2025 mozillazg · Powered by pelican-bootstrap3, Pelican, Bootstrap · Privacy

Creative Commons License "mozillazg's Blog" by mozillazg is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, except where indicated otherwise.

Back to top