How to Completely Remove Apps & Software in Mac OS X by Manual Terminal Uninstall
Most apps in Mac OS X can be uninstalled easily by dragging them into the Trash from the /Applications/ folder, and many others come with accompanying uninstall applications that will clean house and completely remove the apps too. Additionally, there are third party utilities for Mac OS that can make total removal of apps as simple as drag and drop.
Another solution, which is best reserved for and intended for use by advanced Mac users only who are comfortable with the command line and have a deeper knowledge of Mac OS X, is the thorough manual removal of an app and all associated components, and that’s what we’ll cover here.
This process method is much more technical, and relies on the terminal to accomplish the complete uninstall procedure. Again, this is intended for advanced users only, and it is rarely necessary to remove an app or application components this way. We’ll break the steps into a few parts, first will be finding the app and related components, which requires some level of knowledge and discretion to determine what is related and what is not, and second, the actual removal of the appropriate files. If you’re an expert user who is very comfortable with this prospect and you just want some actionable command without any explanation as to what’s going on and why, you can jump to a condensed version below.
How to Find All Components of Apps / Software in Mac OS X
mdfind -name "application name"
*You can also use the broadest possible search without the -name flag but your results may be less accurate, whether that’s useful is up to you
For example, to find associated files and components with Teleport, the Mac OS X keyboard and mouse sharing utility for controlling multiple Macs with a single keyboard, you could use the following:
mdfind -name "teleport"
This broad search should return everything on the Mac that is associated with the name of the application – this does not mean you should delete everything returned by the search though. Carefully example everything that is found, you may need to adjust your search parameters to determine if you’re finding all the necessary components of the application and/or software.
Generally speaking, you’re looking for binaries, the .app files, and remnant pieces of the software, like plist files, preferences, caches, daemons, and other accessory files and components associated with many apps in OS X. Application components may appear in a wide variety locations, including but not limited to the following file paths:
~/Library/Saved\ Application\ State/[Application]
To reiterate, this may or may not be a full list of where related files are stored for a given application, this is why it’s important to pay attention to what is reported by the mdfind command. If what you’re looking to completely uninstall is a command line utility, it may have components in a variety of binary folders, whether /usr/bin /usr/sbin or others,
Completely Removing Apps & Remnant Application Components
Remove only the related files that are appropriate to delete, there is no universal answer to this which is why you need to pay attention to the files that are found through mdfind utility. Be sure you know exactly what file it is that you are deleting and why you are deleting it – as mentioned already, this is really intended for expert users with advanced knowledge of Mac OS X – you don’t want to accidentally remove the wrong thing. You can then permanently delete the files with either the rm or srm command, if you’re not familiar with the rm command, it’s not reversible, so use with caution or you could unintentionally delete something important.
If you’re not incredibly confident in what you’re doing, you should at least back up the Mac before going any further, which is a good idea to do regularly anyway.
Here’s an example of the rm with a sudo prefix to allow for administrative privileges, removing some fictitious files at imaginary locations (yes, these are made up to prevent copy/pasting and misuse of the ridiculously powerful rm command):
sudo rm -rif ~/Directory/Component/Removeme.pane
sudo rm -rif /TheLibrary/LaunchDaemons/sketchyd
sudo rm -rif /usr/sbin/crudrunner
sudo rm -rif ~/Download/sketchydaemon-installer.tgz
sudo rm -rif ~/.Tofu/Preferences/com.company.crudrunner.plist
Again this is an example, the ‘sudo rm -rif’ component is real but none of the directories or files are, it’s going to completely depend on what you find with mdfind and what you determine should be removed.
Impatient? Command line expert and know exactly where to find junk? Here’s the condensed version, sans explanation – don’t jump to this if you don’t know what you’re doing:
- Trash the known application files
- Launch Terminal and use the following syntax to find remnant components
- Remove associated files from system locations with rm:
- Repeat as necessary with associated component files returned by mdfind
mdfind -name [application name]
sudo rm -rf /Whatever
You can also choose to remove the components from the GUI with the Finder. Trashing user cache files and other ~/Library/ components is easily done through the Finder of OS X, whereas digging around in deep system folders or unix directories like /usr/sbin/ with the GUI is not particularly recommended. This process does work to remove default software that comes bundled with Mac OS X, though without a very compelling reason to do so, that is not recommended.
If any of this seems over your head, it’s because this is really much more advanced than what an average Mac user would ever need to do it. For the vast majority of Mac users, it’s best to resort to a more traditional app uninstall methods, or use a thorough application uninstaller utility like AppCleaner, which is free and basically does the same search process but through an automated graphical user interface.