Launch program from terminal
How do I launch a program from the "terminal" window?
MacBook Air 13", macOS 10.15
The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.
You can continue to find trusted guidance and support on the official Apple Support site.
We want to thank the community members who have contributed their time and expertise to help others with their Apple products.
The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.
You can continue to find trusted guidance and support on the official Apple Support site.
We want to thank the community members who have contributed their time and expertise to help others with their Apple products.
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