Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes emptying the trash in Finder takes significantly longer than just running rm -rf ~/.Trash. Is there some way to remap the "right click on trash in dock + click to empty trash" button to a script?

share|improve this question
Welcome to AskDifferent! This site works better if there is just one question in a post. I've edited your question accordingly, feel free to ask additional questions separately. – patrix Apr 29 '13 at 4:46
Understood, I'll submit the query about the "whys" of the issue separately. – Kaya Apr 29 '13 at 5:32
up vote 1 down vote accepted

It would be easier to use an alias like this:

alias et="(shopt -s nullglob; find ~/.Trash /Volumes/*/.Trashes/501 -mindepth 1 -delete)"

rm -rf ~/.Trash/* doesn't work if the list of filenames is longer than getconf ARG_MAX, and it doesn't include files that start with a period. Deleting files in trash folders often requires root permissions though.

tell app "finder" to empty and trash -e (see can be run silently or on the background, but they are just as slow as emptying the trash from the GUI, and they make Finder display error dialogs if for example files are in use.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.