How to find out what is deleting the ~/.Trash folder

finderfolderstrash

Some application or action is deleting my ~/.Trash directory. I obviously don't know when this happens, save for the "Are you sure you want to delete…" dialog box.

I can restore the Trash, by restarting the Finder, as per this question, but I would like to figure out what is doing this.

Is there a way to monitor a directory (i.e., .Trash) and determine when it changes? So when my Trash is deleted, I'll know.

Best Answer

This will display every file deletion on your system. If you want to only display the deletion of "~/.Trash", add | grep .Trash to the last command.