Posted on 08-17-2020 11:56 AM
Hi, I've an uTorrent.app in Application folder in Mac.
Please help me with a bash script to delete/remove/uninstall it.
Posted on 08-18-2020 09:06 AM
Can’t you just run a files and process policy
rm -rf /Applications/uTorrent.app
Posted on 08-20-2020 07:36 AM
I did try and that would remove. However, how about the content files in ~Libary/*?
Posted on 08-24-2020 05:54 AM
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.