Launch program from terminal
How do I launch a program from the "terminal" window?
MacBook Air 13", macOS 10.15
Apple Intelligence is now available on iPhone, iPad, and Mac!
How do I launch a program from the "terminal" window?
MacBook Air 13", macOS 10.15
If it is a GUI application (e.g. .app)
open -a "application name" URL or document name
open -a Safari "https://www.apple.com"
otherwise, it would depend where in the filesystem, the non-GUI application resides, what your PATH environment variable has been set too, and what arguments the command takes from the command-line:
man -t zsh | open -f -a Preview
ruby -e 'puts ARGV.first.capitalize;' "CAT_AND_MOUSE_GAME"
~/Desktop/customprog.py ~/Desktop/input.txt
./located_right_here ./"white-space punctuated input".txt
The tilde (~) character is shorthand for your home directory (e.g. /Users/yourname, etc.). The leading dot means in the current folder location.
If it is a GUI application (e.g. .app)
open -a "application name" URL or document name
open -a Safari "https://www.apple.com"
otherwise, it would depend where in the filesystem, the non-GUI application resides, what your PATH environment variable has been set too, and what arguments the command takes from the command-line:
man -t zsh | open -f -a Preview
ruby -e 'puts ARGV.first.capitalize;' "CAT_AND_MOUSE_GAME"
~/Desktop/customprog.py ~/Desktop/input.txt
./located_right_here ./"white-space punctuated input".txt
The tilde (~) character is shorthand for your home directory (e.g. /Users/yourname, etc.). The leading dot means in the current folder location.
rodg495 wrote:
How do I launch a program from the "terminal" window?
ex. To open iTunes:
open -a iTunes
Use quotation marks if the application has a space in its name:
open -a "App Store"
You can see more examples from the terminal itself, copy and paste:
man open | more
Launch program from terminal