Have you ever tried to empty your trash, only to be stymied by this message…
The operation cannot be completed because the item ABC is in use.
If so, one surefire fix is to restart the machine. But that can be time consuming, and requires quitting and restarting all your applications. Here’s another possible solution—note that this won’t work in all cases, but when it does, it’s a handy timesaver.
The next time you see the “in use” message, click on the Trash icon in the Dock to open its window. Then open Terminal (in Applications -> Utilities) and type
lsof, then press the space bar. In the Finder, find the item that was “in use” in the Trash window, and drag it to the Terminal window. Switch back to Terminal and press Return. What you’ve just done is asked the
command, which lists open files, and to only show items that match the name you dragged in from the Trash window.
If anything is found, the output of the command will show the “controlling” application in the first column. For instance, here’s what a JPEG image opened in Preview looks like to
Preview 2733 robg txt VREG 14,12 16119 9889039 /Users/robg/Desktop/hrmonitor.jpg
Once you know the controlling application, you can quit that program, then (most likely) successfully empty the trash. As I said, this won’t work in every case, and you may still be forced into a restart (or perhaps just logout / login). But if it works, you’ll be glad you gave it a shot!