According to Apple's File System Programming Guide, macOS includes so-called UNIX-specific directories:
The directories in this category are inherited from traditional UNIX installations. They are an important part of the system’s BSD layer but are more useful to software developers than end users.
These are hidden to the user, and include /bin
, /tmp
, /dev
, /usr
, and more.
My question is: how can I identify these directories?
I notice that chflags
has a UF_HIDDEN
flag, which I thought might help, however while UF_HIDDEN
is set on /bin
and /dev
, it is not set on /tmp
(so it must not be set for all UNIX-specific directories). I was also wondering if mdls
could help, as I notice the following:
kMDItemSupportFileType = (
MDSystemFile
)
However, this value (MDSystemFile
) is present on /bin/bash
as well as many other files that are not UNIX-specific directories (as they are files). I thought it might be possible that the file is a UNIX-specific directory if the kMDItemSupportFileType
contains MDSystemFile
, and the file is a directory, however this theory also fell apart as MDSystemFile
is not present for /tmp
.
How can these UNIX-specific directories be identified?