Open multiple urls from Terminal I can open one chrome window through

open https://en.wikipedia.org/wiki/Main_Page


I can also open multiple URLs by multiple lines

open https://www.youtube.com/
open https://en.wikipedia.org/wiki/Main_Page


The following won't work though

open https://www.youtube.com/ &amp;&amp; https://en.wikipedia.org/wiki/Main_Page


but it works with

open https://www.youtube.com/ &amp;&amp; open https://en.wikipedia.org/wiki/Main_Page


I want an elegant inline expression like

open ('https://www.youtube.com/','https://en.wikipedia.org/wiki/Main_Page')


How to do that?
Just supply all of the URLs you want to open as arguments to a single open command:

open https://www.youtube.com/ https://en.wikipedia.org/wiki/Main_Page


The open command has been written to handle this.

The reason it doesn't work with &amp;&amp; is that in shell syntax, &amp;&amp; is a delimiter between different commands, not between arguments to the same command. So it was trying to run https://en.wikipedia.org/wiki/Main_Page as a separate command, which doesn't work.

More specifically, &amp;&amp; runs the second command only if the first command succeeds. There are a number of command delimiters you can use with different meanings:

cmd1 ; cmd2    # Runs cmd1 and then cmd2 (just as though they were on different lines)
cmd1 &amp; cmd2    # Runs cmd1 and cmd2 simultaneously, with cmd1 in the background
cmd1 | cmd2    # Runs cmd1 and cmd2 simultaneously, with cmd1's output piped to cmd2's input
cmd1 &amp;&amp; cmd2    # Runs cmd1, and then if it succeeds runs cmd2
cmd1 || cmd2    # Runs cmd1, and then if it fails runs cmd2