-1

I read here https://medium.com/@marksiu/what-is-plistbuddy-76cb4f0c262d

that PlistBuddy is in usr/libexec/PlistBuddy. But it is not there or at least I can't find it. Do you have to install something to get this ? I have xcode 12.5.1 installed with command line tools on my Mac.

[Terminal Output1

Text version:

$ ls -l /usr/libexec/PlistBuddy
-rwxr-xr-x  1 root  wheel  159728 Jan  1  2020 /usr/libexec/PlistBuddy
$ cd /usr/libexec
$ PlistBuddy
zsh: command not found: PlistBuddy
3
  • What version of macOS are you running? If in Terminal you run the following command does it return anything? ls -l /usr/libexec/PlistBuddy Sep 20 at 15:52
  • Please see screenshot Sep 20 at 15:58
  • screenshots can't be read - if it is text then show the text as text
    – mmmmmm
    Sep 20 at 16:45
3

PlistBuddy is there as shown by the output in the screenshot of Terminal in your question:

ls -l /usr/libexec/PlistBuddy
-rwxr-xr-x  1 root  wheel  159728 Jan  1  2020 /usr/libexec/PlistBuddy

The problem is that /usr/libexec/ is not in the path or PATH passed to the shell and once you cd into a directory that is not within the path or PATH passed to the shell you need to preface the command with ./, e.g.,:

./PlistBuddy

Or just use it's fully qualified pathname, e.g.,:

/usr/libexec/PlistBuddy

From a clean install of macOS Big Sur 11.5.2:

 % ls -l /usr/libexec/PlistBuddy
-rwxr-xr-x  1 root  wheel  159728 Jan  1  2020 /usr/libexec/PlistBuddy
 % echo $path
/usr/local/bin /usr/bin /bin /usr/sbin /sbin
% echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
 % cd /usr/libexec/           
 % PlistBuddy               
zsh: command not found: PlistBuddy
 % ./PlistBuddy                 
Usage: PlistBuddy [-cxh] <file.plist>
    -c "<command>" execute command, otherwise run in interactive mode
    -x output will be in the form of an xml plist where appropriate
    -h print the complete help info, with command guide
 % 

You must log in to answer this question.

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