How to run PlistBuddy
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.
[
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
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
%