Here’s a question about the Mac user command line environment.
I’m not as good as I should be with the command line, but I have a question that I’m sure some, if not many, TidBITS talk readers might help with.
First, I’ll start with a tip. If you ever use your Terminal app, you are probably aware of the path that tells your Terminal (and other stuff) what commands to use, so you don’t have to type in the full path of the command (example: if you have a Silicon Mac, and have installed Homebrew to manage command line programs on your Mac, you’ll probably know that by default, Homebrew puts many commands in the folder “/opt/homebrew/bin/”. Homebrew typically adds that folder designation to your path environmental variable so you can use programs by typing the name without prepending “”/opt/homebrew/bin/" to the command line. For me, and for many users of the zsh shell environment that is default for Ventura, that specification exists in an invisible file in my home folder called “.zshrc”.) I may not have explained that well or even extremely accurately.
Anyway here’s the tip. The following is a command line function you can add to your zshrc (or basic) or other file where your system’s environment is configured) that will allow you to enter the command cpath
in a Terminal window to see a one-per-line listing of your path items:
function cpath {
echo "$PATH" | tr ':' '\n' | sort | uniq -c
}
You can replace cpath
with seepath
or something else.
My question is this. I don’t view the path as often as I should, now I’m seeing some entries that don’t seem as though they should be there. Can anyone tell me where those included at the end of this post came from, or offer advice about how I can find out where they came from? As a rule, Apple doesn’t include any changes in software updates or installations that affect the user’s command line environment. Here are the unfamiliar path entries viewed using the cpath
command explained above (one per line). Thanks.
/System/Cryptexes/App/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin