1

I want easy access to PlistBuddy, which I wasn't even sure still shipped with macOS (Big Sur 11.3 here).

I found it in /usr/libexec, a directory I don't know well, but which contains a large number of executables, some of which I already use. So why isn't /usr/libexec in the default $PATH?

I prefer a big $PATH, and if it's safe, and I would edit my ~/.${SHELL##*/}rc with something like this:

export PATH=/usr/libexec:${PATH}

instead of adding this:

alias PlistBuddy=/usr/libexec/PlistBuddy

Is there any reason not to?

6
  • What do you mean with "risk"?
    – nohillside
    Mar 1, 2021 at 19:49
  • @nohillside: I’m assuming there’s a reason, maybe security‑related, why a directory with so many executables isn’t, by default, in the $PATH.
    – Lucas
    Mar 1, 2021 at 22:11
  • Well, most of these commands are rarely used directly.
    – nohillside
    Mar 1, 2021 at 22:12
  • Anyway, which risks do you worry about which don‘t also apply to /usr/bin?
    – nohillside
    Mar 1, 2021 at 22:13
  • 2
    I'd just create a symlink for it to /usr/local/bin/PlistBuddy, e.g.: sudo ln -s /usr/libexec/PlistBuddy /usr/local/bin/PlistBuddy Mar 2, 2021 at 12:03

1 Answer 1

2

You should not add /usr/libexec to your path.

/usr/libexec is intended for "system daemons & system utilities (executed by other programs)". This is the description from the command man hier.

So you don't want to directly run something from there by mistake.

If you have a reason to run one of those executables directly it is better create an alias.

You must log in to answer this question.

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