Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 8
    || is the opposite of &&: the RHS is executed if the LHS does not succeed: false || echo yes # prints "yes" Commented Nov 11, 2013 at 0:15
  • 3
    This accepted answer might also point out another difference being that with && the linked commands form a compound command which is jointly backgrounded subsequent & whereas the ; being two sequential commands will wait for completion of the first command before a trailing & will background the second command. sleep 5s && sleep 5s & echo "waited 0s" vs "sleep 5s; sleep 5s & echo "waited 5s" Commented Aug 4, 2016 at 14:38