10

I'm new to Monterey, coming from (I think) the last version of OS X before it became macOS -- definitely before this SIP stuff started to make life interesting.

I used to be able to say these things

$ ls /Applications
$ open /Applications/Messages.app

and get the obvious (working) results. Now, while I can see all of /Applications in Finder, I get a truncated list (of things I've installed and Safari.app / Xcode.app for some reason):

# ls /Applications
Firefox.app         MenuMeters.app  Utilities       calibre.app
Google Chrome.app   Safari.app      VLC.app         TeX
VictronConnect.app  MacPorts        Xcode.app

$ open /Applications/Messages.app
The file /Applications/Messages.app does not exist.
$ open -a Messages
<app opens just fine>

(XQuartz.app is visible in Utilities but nothing else.)

I have set Terminal.app to have full disk access in System Preferences. I'm running bash from MacPorts.

Is there a way to convince SIP (?) to allow ls and open to work in these special directories?

I can't be the first person to wish this behaviour were more permissive but I've had no luck googling it.

Thanks!

1
  • 1
    /System/Applications Commented Jan 1, 2022 at 0:21

2 Answers 2

18

Starting in Catalina (10.15), macOS uses a split-volume format, with the system software on a locked volume and a separate "Data" volume for user data, user-installed software, etc. Most folders contain just one of these things, so they reside on just one volume, but the Applications folder has both, so it's handled... strangely.

What's really going on is that there are two Applications folders. The built-in system applications are in /System/Applications (which is on the read-only system volume), and user-installed apps (including Safari, 'cause it's weird) are in /Applications (which is actually a firmlink to /System/Volumes/Data/Applications on the Data volume).

Net result: at the command line, you have to look in two different places, /Applications and /System/Applications, to see all of the apps installed on your Mac.

The Finder shows their contents merged together, but this is just a convenient illusion -- the reality is that there are two different folders, and at the command line you see that reality.

Here are a couple of good articles at the Eclectic Light Company about this: "macOS Catalina Boot Volume Layout" and "Big Sur boot volume layout".

1
  • Thanks Gordon. That's what I wanted to know.
    – Peter
    Commented Jan 1, 2022 at 21:44
4

I am not sure why you want to enter the command below.

open /Applications/Messages.app

I believe the proper command would be the following.

open -a Messages

Basically, the operating system is separated into a read‑only volume and a read‑write volume. These volumes can appear separately or as combined. When using the Finder, you viewed as combined. From the Terminal, you accessed just the read‑write volume. So while the command below would work by accessing the read‑only volume, using the -a option would not require knowing where the application resides.

open /System/Applications/Messages.app

 

2
  • 2
    I can tab-complete the former but not the latter. I guess I'd be satisfied if I could tab-complete open -a. Perhaps Apple's zsh allows you to do that, but not my MacPorts bash. But really, even if the volume is read-only there's no reason I shouldn't be able to apply ls to it.
    – Peter
    Commented Jan 1, 2022 at 21:42
  • 1
    I have never though of using tab-completion with respect to the open command. Good to know. Commented Jan 1, 2022 at 23:29

You must log in to answer this question.

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