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

Click here to return to the 'Cannot empty trash because item is in use' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Cannot empty trash because item is in use
Authored by: dbingham on Jan 20, '11 10:50:43AM
Bad. Bad shell scriptor!

What if I made a typo in the directory name? The way you wrote the command, you run a VERY real risk of deleting everything in your home directory. Which, presumably isn't something you want to have to recover from.

Much, MUCH better would be:
$ cd ~/.Trash && rm -rf *

I know you said "handle with care", but such a simple modification makes it MUCH safer.

Remember friends, when one command depends on the successful completion of another command && is what you want. Not ;.

[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: marshaul on Aug 22, '13 12:06:39PM
What's the point of CDing in the first place? Why not:

rm -rf ~/.Trash

There's no point to changing to that directory if you only wish to perform a single action in that directory.

Even better:

rm -rf ~/.Trash; rm -rf /Volumes/*/.Trashes

[ Reply to This | # ]