Have you ever wanted to run 2 commands at once? If you want to run 2 commands at the same time, use |
. If you want the first command to run successfully before running the second command, use &&
.
In the video above, I use sleep 5
to pauses the execution for 5 seconds.
When using |
, “Hello” was displayed right away. When using &&
, “Hello” was displayed after 5 s.