Tuesday, July 10, 2012

How to run two linux commands in one line?

Use && or || in the command

examples:
$cd dir && ls -al
$./startup.sh && tail -f ../logs/catalina.out
&& doesn't run the second command if the first doesn't complete successfully
|| runs both commands

No comments: