In a followup to
this hint on 'lsof', I'd like to mention a free, open-source Cocoa GUI wrapper I did for
lsof called
Sloth, which presents a list of open files on your system along with the owning process. It has "Reveal In Finder" and "Kill" buttons to make it easier to get around annoying messages such as these:
The operation cannot be completed because the item [whatever] is in use
With Sloth, you can easily find the owning process in question and kill it. Of course Sloth doesn't support all the fancy advanced options which can be passed to
lsof, but it's just fine for most functionality.