Is it possible to know the .plist file location which is loaded into the launchctl command?
The label name is listed with \"launchctl list\" and its contents can be view
Here is the command to list all loaded .plist
files and their corresponding files:
find /System/Library/Launch* /Library/Launch* ~/Library/Launch* -name '*.plist' -exec sh -c '/usr/libexec/PlistBuddy -c "Print Label" {} && echo {}' ';' | grep -wf <(launchctl list | grep -o "\S\+\..*$") -A1 | strings
or another version:
find /System/Library/Launch* /Library/Launch* ~/Library/Launch* -name '*.plist' -exec /usr/libexec/PlistBuddy -c "Print Label" {} ';' -print | grep -wf <(launchctl list | grep -o "\S\+\..*$") -A1 | strings
Explanation:
find
all .plist
files in the following locations: /System/Library/Launch*
/Library/Launch*
~/Library/Launch*
PlistBuddy
command to print Label
of all found .plist
files.-print
parameter of find
to print the path to that file.launchd
and use as pattern file for grep -f
.-A1
).strings
to avoid printing binary files.