There is a stubborn folder in my trash bin that apparently cannot be deleted because "something is using it". I know how to force empty the trash bin, but rather than doing it, I'd like to know exactly who is using this file.

Is there a way to determine what application/process is supposedly using a file/folder?

Mac OSX Yosemite.


Yes, the lsof command will show you that. Open a termin and type "lsof [folder name]" and the command and process id should be listed.


Trash is special - often the file isn't open.

  1. Restart to close all files (the system almost never opens a file that's in trash)
  2. Empty again
  3. Force empty - hold alt/option and empty trash

Worst case, you can use lsof but since the trash could be an external drive or an internal drive or a user item - the "trash" is a combination of several locations.

sudo lsof ~/.Trash/ /.Trashes/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .