Uninstal an Application in Mac

VincentBoidyo
New Contributor II

Hi, I've an uTorrent.app in Application folder in Mac.
Please help me with a bash script to delete/remove/uninstall it.

3 REPLIES 3

Cayde-6
Release Candidate Programs Tester

Can’t you just run a files and process policy

rm -rf /Applications/uTorrent.app

VincentBoidyo
New Contributor II

I did try and that would remove. However, how about the content files in ~Libary/*?

PaulHazelden
Valued Contributor

Do you know what the content files are called?
If you do then you can remove them...

Accounts=$(dscl . list /Users | grep -viE '(_|admin|Guest|.DS_Store|.localized|root)')
for EachAccount in "$Accounts"
do
rm -Rf /Users/"$EachAccout"/Library/<STUFF TO DELETE>
done

If you test this bit...

dscl . list /Users | grep -viE '(_|admin|Guest|.DS_Store|.localized|root)'

You may want to add in some other exceptions, just follow the syntax for it. This will not be case sensitive, so Admin and admin will be excluded, as will Administrator.
This is looking at the actual User accounts, and not the Home folders to find the account names.
Once you have the list of User accounts you want, and have the correct path to the files you want to delete. That should pretty much do it.
As with all things script wise, Test it first, several times
If you put...

echo "/Users/$EachAccount/Library"

In the place of the rm line and run, you will get back from Terminal a list of the places where the rm command would run. This way you get to check it before it actually removes any files.

If there are several files to delete just add in extra rm lines with the path to the files.