Mac OS X: How can I see who is using the files I'm trying to delete?

I have a couple of files that I want to delete. So I select them and then do Move to Trash. However, when I do so I get this message:

Some of the items you are moving are in use by another application. Moving the items can cause problems with the application using them. Are you sure you want to move these items?

[Stop] [Continue]

My problem is that I can't find any applications that are using these files. I also tried to run

lsof | grep <part of filename>

But I couldn't see anything there either. What is going on? How can I find out why the file is "locked"? Is there anything similar to the LockHunter or Unlocker applications on Windows?

Note: I realize that I could probably try to just click continue instead of stop, but I'd like to know first and also learn if there is anything I can do. If I override whatever is holding them and deleting them, I won't have a way to test suggested solutions here :p

Note: For others reading this post; I have discovered that I do not have to use grep at all. I can just do lsof <filename>. Probably something most people know, but I didn't :p


As Debilski notes, you might consider rerunning your command with sudo.

A likely culprit that I've often found is QuickLook: if you preview a file prior to trashing it there might be a relatively short lock on the file. If that's the case, once the lock is up (or you logout) you should be able to trash the file.


Just use fseventer, as per this awesome answer to a similar question.

fseventer