Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Dec 312009

How to run multiple commands at once in Linux?


You can separate the commands by a semicolon ;


cat foo.txt; cat bar.txt

Two commands will be executed one by one.

However, if you want to execute a command if and only if previous command is executed successfully, then you can use && to separate them


make && make install

So if make failed, make install will not be executed.

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>