Sometimes when emptying the Trash on your Mac, you may get error messages that tell you files you’re trying to delete are in use. When you’re looking to delete everything that’s in your Trash to free up some storage space, error messages are going to be the last thing you want to see.
In this piece, we’ll talk about why you’re getting these messages and how to get your Mac to free up the file so you can delete it safely.
Mac still using files in your Trash?
I get messages multiple times per day where my Mac has an aneurysm and says “This operation can’t be completed because the item “[insert file name here]” is in use.”
These messages are entirely annoying because when I decide to empty my Trash, I’m doing it because I want to get rid of everything inside of it, not because I want to see error messages.
Because this is a widespread message among Mac users, it seemed like a good idea to discuss why you’re getting these messages, and to talk about possible solutions to the problem.
What’s going on?
Basically what your Mac is telling you is that a file from your Trash is still open in one of your Mac’s own apps.
What’s happening here is you’re trying to erase a file from your Mac’s filesystem that an app is still using. By erasing it, you would break something, whether it’s an email you’re composing with the attachment in the email, an open preview of a file you were viewing, or a file transfer of the file you were initiating through your favorite instant messenger client, and your Mac prevents you from breaking things by keeping you from deleting the file until the app is finished with using it.
Throughout my own daily work routine, the following apps have been known to cause the error message for me:
Although there are probably many more to add to this list, I use these four apps continuously throughout my workflow. The problem occurs mostly when I have text files, image files, or video files open in one of these apps, and then I try to delete the file after I’m done with it.
Unfortunately, although I’m done with the file, macOS apparently is not (yet).
For example the Mail app will make Drafts of emails in the midst of typing them before they are sent to the recipient. These Drafts have instances of the file you’re attaching, so even though you might have sent the email when you are finished composing it, the Mail app is still technically using an instance of that file in a saved Draft stored somewhere on your computer.
Now, when you try to remove that file from your Mac because you’re done with it, you’ll activate an error message saying the file is still in use.
Fixing the problem
Since you now understand that you’re getting the error message due to a process still using a file in your trash, you’re probably wondering what to do about it…
Well, the solution is an easy one: quit the app that’s using the file.
On the other hand, it can sometimes be difficult to pinpoint exactly what app is using the file, so you’ll have to take a moment to recall.
When I get one of these messages, I like to open the Trash to see what file(s) failed to delete. Then, I try to remember what app(s) I used the file in recently. If I recall that I just sent the file in Mail, or that I have it open in a file transfer in Skype, I can easily quit one of the aforementioned apps to close any open processes that might be using the file.
One of the more convenient ways to quit an app is to right-click on the icon in your Dock, and then choose the Quit option:
Alternatively, you can also quit an app from the Menu Bar, or by pressing Command ⌘ + Q from the keyboard while the app is open and running in the foreground.
Read more: 6 ways to quit an app on your Mac
After you quit the app you suspect is still using the file you’re trying to delete from your Trash, you can attempt to empty the Trash again. Hopefully it’ll work this time around, but if it doesn’t, then you know it’s another app using the file rather than the one you just quit out of.
Just keep going down the line with apps that are running and continue to try deleting the file.
Keep in mind that any open processes, such as file transfers in instant messenger apps, will be cancelled if you delete the source file. If you have reason to believe this is why the file is too busy to be deleted, then you might want to let your file transfers complete before you delete the file.
I quit everything, but still can’t delete the file
If you have quit everything you can think of, and the file is still being used by macOS, then there is only one other thing you can do: turn your Mac off and on again.
This will quit all of the macOS processes and force your Mac to restart all of its services. Once your Mac is rebooted and you’ve logged back in, you should be able to safely empty your Mac’s Trash without harming anything because the file hasn’t been initialized in any of your apps’ running processes.
Now that your pesky little file has been removed from your Trash, you should have a nice shiny empty Trash icon in your Mac’s Dock again and the peace of mind that nothing is wasting any storage space on your Mac.
Also read: The difference between emptying the Trash normally and securely
Have you run into this problem before? How did you solve it? Share in the comments below!