2

When I try to open 'chrome' or 'safari' in terminal,

$ safari
-bash: safari: command not found
$ open safari
The file Desktop/safari does not exist.
$ chrome
-bash: chrome: command not found

How to open them in right methods.

0

Its trying to open the files from the Desktop folder. Safari is in the Applications folder. From the top level / you should type open Applications/safari This works fine for me. cd up to / and do ls. The Application folder should show up. If not you are in the wrong directory.

  • 1
    All you need to do in Terminal, no mater what the PWD, is use open -a Safari or open -a Google\ Chrome and if wanted, add the URL afterwards if you want to open the Browser to the given URL. You do not need the type the pathname or the .app extension. – user3439894 Nov 16 '17 at 0:24
5

All you need to do in Terminal, no mater directory you're in, is use open -a Safari or open -a Google\ Chrome and optionally, add the URL afterwards if you want to open the Browser to the given URL: open -a Safari http://apple.com/.

  • 1
    All you need to do in Terminal, no mater what the PWD, is use open -a Safari or open -a Google\ Chrome and if wanted, add the URL afterwards if you want to open the Browser to the given URL. You do not need the type the pathname or the .app extension. – user3439894 Nov 16 '17 at 0:25
  • oh thanks. I'll edit my answer then, why didn't you add an answer. – Wis Nov 16 '17 at 0:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .