Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Uninstall applications installed from packages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Uninstall applications installed from packages
Authored by: CarlRJ on Jan 12, '10 03:45:59PM

DANGER WILL ROBINSON!!!

sudo xargs rm is the Mac OS X equivalent of a loaded firearm with the safety off, and this hint, despite the "I haven't tried it with names with spaces" disclaimer, borders on irresponsibility.

If you really know what you're doing, reading through the output of lsbom (along with the associated preinstall / postinstall / preupgrade / postupgrade files) can be useful to figure out how a program gets installed, and thus how to go about removing it. But please, I beseech you, don't ever pipe a list of files that you haven't personally carefully inspected, into something like sudo xargs rm. Don't put a wood chipper in your living room, in place of a wastebasket, either.

And for the record, xargs does choke on spaces:

$ echo "/Library/Application Support" | xargs ls
ls: /Library/Application: No such file or directory
ls: Support: No such file or directory
$

One can get around this particular problem by using the -0 option of xargs:

echo /Library/Application\ Support | tr '\n' '\0' | /usr/bin/xargs -0 ls

But remember folks, Unix gives you enough rope to shoot yourself in the foot. It will, for better or worse, do exactly what you tell it to do, so make sure you really know what you're asking.



[ Reply to This | # ]