Apple Users
Related: About this forumanyone know of a good simple tutorial on how to launch a app using mac os big sur thru
terminal? thanks
4dog
(520 posts)I googled MacOS Terminal Manual and got to Terminal User guide at support.apple.com. Labeled for my later OS but basics are not likely to change. There's a search option there; under first page of hits from 'launch app' was 'Execute commands and run tools in Terminal on Mac'.
But why not just put the app in the Applications folder and double-click?
AllaN01Bear
(23,047 posts)usonian
(13,836 posts)From stackexchange (short version)
How can I open an app using Terminal
http://apple.stackexchange.com/questions/355037/ddg#355040
You can use opens -a option:
open -a Mail
You can specify the application path instead:
open /Applications/Mail.app
(cool applescript not shown)
-----------------------
Apps in the /Applications directory seem to work fine. (I don't know if anything in your $PATH will do so as well)
A bit more here (with pictures)
https://www.wikihow.com/Open-Applications-Using-Terminal-on-Mac
and more than you ever wanted to know, ever:
>man open
GOOD LUCK.
_____
Now, here's the secret sauce: an application is a DIRECTORY. But behaves like a file.
You can look at an app in the finder and right click/control click "Show Package Contents" to explore, but please don't change anything!
And P.S., you can "cd" to anywhere on the file system, and in the terminal that got you there
"open ." and that opens a finder window.
AllaN01Bear
(23,047 posts)you just "triggered " me in a good way. i remember that term from my old disc operating system days. cd and cd.. comes from my dos days and linux days, as base file system is bsd . thanks for your advice .
usonian
(13,836 posts)Just can't figure how to register this as a religion.
Apple changed default shells for some IP reason. I only upgrade by buying a new computer. Rarely, at that.
That is all.
CloudWatcher
(1,923 posts)This is likely more than you wanted to know, but ... you asked ... and for anyone else trying to use open ....
Big Sur has some magic under the hood for "merging" directories and while it's usually something that can be ignored, when you use "open" it becomes very visible.
Let's take a simple example: launching the Mail application.
In older Mac OS's you can do this in a Terminal shell window:
And it will launch the Mail application. But under Big Sur this same command fails. It's like Mail.app doesn't exist. You'll actually get the error:
But ... but ... when you examine /Applications with the Finder, you see Mail.app sitting right there.
So what's going on?
Apple has moved their apps and are using some slight-of-hand to mostly make it look like it did before.
The new layout is like this:
Customer installed utilities go in /Applications/Utilities/
MacOS supplied applications go in /System/Applications/
MacOS supplied utilities go in /System/Applications/Utilities/
Looking at /Applications with the Finder shows the combined contents of /Applications and /System/Applications. And looking at /Applications/Utilities also shows the merged contents.
So ... wtf? Why did they do this? Because now the apps in /System/Applications/ are much more protected from malware. All the files under /System/ are almost impossible to modify outside of actual Apple-supplied updates.
And it "just works" if you use the normal user-interface to launch applications.
But if you use the "open" command in Terminal you'll need to give it the right path (when using paths).
So on Big Sur, the correct command to launch Mail is:
For a fun time, you can use the "ls" command to see where apps really live:
ls /System/Applications
You'll see MacOS built-in apps in /System and customer (and Apple Store) supplied apps in /Applications. Note that "ls" is "el" and "s" ... not "one" and "s".
Pro tip #1: use the "tab" key for filename completion. What I type is:
where TAB is just the tab key. And the shell will complete the path for me and prints out:
it will beep at you if what you've supplied (before hitting TAB) doesn't exist or is not unique.
Pro tip #2: you'll need quotes to enclose special characters in paths, especially spaces. E.g.
Ok, enough for now. Hope this helps someone ... someday
Tetrachloride
(8,448 posts)= nicely done. ty
CloudWatcher
(1,923 posts)You're too kind, thanks
I live and work in terminal. My family thinks it is funny ... but I've been using Unix since about 1980 and I've got my fingers trained for it.
Tetrachloride
(8,448 posts)large screen workstations, Spring 1986. In my class of about 22, my partner and i were of the top 3 effective teams.
I should have been in the West Coast but
.