To do this you would type:
command1 && command2 |
command2 will be executed if command1 successfully completes (if command1 fails command2 won't be run). This is called a logical AND.
To do this you would type:
command1 || command2 |
command2 will be executed if command1 does not successfully complete (if command1 is successful command2 won't be run). This is called a logical OR.
To execute commands sequentially regardless of the success/failure of the previous you simply type:
command1; command2 |
command2 will execute once command1 has completed.
![]() |
More than two commands |
|---|---|
|
You can continue to use ';' (semicolon) characters to do more and more commands on the one line. |
| Last updated Tue Nov 7 01:51:01 CET 2006 | Permalink: http://www.karakas-online.de/gnu-linux-tools-summary/performing-more-than-one-command.html | All contents © 2003-2006 Gareth Anderson |