Search the entire HD for filenames that contain a particular string

I am trying to delete remnants from an app with file names that contain the string com.XYZ but I cannot locate these files using the Find button on the Finder window or Spotlight. As a test I searched for "com.apple.LaunchServices", which I know is in ~/Library/Preferences but I do not get any hits at all. How do I search the entire hard disk for all files or folders whose names contain a particular string?

iMac 27″, macOS 12.5

Posted on Sep 2, 2022 11:11 AM

Reply
5 replies

Sep 2, 2022 11:51 AM in response to tmatsoukas

Your find example will only search in the current (.) directory, and that won't find all remnants of a file that took a more widespread approach to installation.


I would do this in the Terminal:


pkgutil --pkgs | grep -i xyz | more


If that returns a package with the name string com.XYZ in it, enter the entire package name below:


pkgutil --files com.XYZ > ~/Desktop/XYZ_files.txt


and you will have a text file on your Desktop with the specific file path to every file installed.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Search the entire HD for filenames that contain a particular string

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.