In default installation of macOS, Python and Bash are installed in /usr/bin
and /bin
directories respectively.
$ which python
/usr/bin/python
$ which bash
/bin/bash
So it's appropriate files can be opened using the command-line as:
python foo.py
Along similar lines, I want the ability to open an HTML file with Google Chrome using the command-line as:
$ chrome foo.html
But I get the following output:
bash: chrome: command not found
An alternate way to achieve the desired workflow is make Google Chrome as the default browser and execute the following command:
open foo.html
How do I achieve the former workflow?
~/bin
to yourPATH
variable, or use/usr/local/bin
which normally is user-writable on macs. And btw,open path/to/file.html
should work without problem, provided that you allowed chrome to take over the extensions.