I can open a url specifying 'chrome browser' from terminal
open -a 'Google chrome' https://en.wikipedia.org/wiki/Main_Page
How to open it in an incognito mode?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Use something like:
open -a "Google Chrome" --args --incognito "https://en.wikipedia.org/wiki/Main_Page"
Google Chrome accepts
--incognito as a command-line option. To pass that option to the application via
open, specify it after the
If Chrome isn't already open (since this was not specified whether the original questioner needed to launch it fresh or if it was already running),
-n is also needed to start a fresh instance.
man open is your friend.
I don't have enough reputation to comment on the above answer, but wanted to add that if you don't have an incognito window open already, you need to add the -n flag to open a new incognito instance. So, using the above example would be:
open -na "Google Chrome" --args --incognito "https://en.wikipedia.org/wiki/Main_Page"
open chrome --args --incognito "websitename.com" to open it in icognito mode