In this guide, we will show you the steps to fix the “The operation can’t be completed because the item x is in use” error when trying to delete a file on Mac. A few users have voiced their concern that they are unable to make modifications to an existing file. Whenever they are trying to do so, they are instead greeted with the aforementioned error message.
This error is mostly imminent when a user is either sending the file to the Bin, selecting a file in the Bin and choosing to Delete Immediately, or when they try to empty the Bin altogether. In all these scenarios, Mac ends up displaying the “The operation can’t be completed because the item x is in use” error. If you are also facing the same issue, then this guide will help you out. Follow along for the fix.
Fix Cannot delete file: Operation can’t be completed item is in use in Mac
While the error message clearly states the reason for this issue, however, the real challenge lies in catching the culprit, in other words, which app or service is currently using your file. Once you get hold of that app, you just need to close it after which you could easily delete at file. So how could you determine which app is having the ownership of your file? Well, this task could be carried out by executing a couple of commands in rhe Terminal. Here’s how:
- Open Launchpad, go to Others, and launch Terminal.
- Then type in the below command, replacing filename accordingly [in our case, the name of the file is droidwin].
lsof | grep filename
- Now note down the PID number. It will be in the second column. In our case, it is 1789.
- Then execute the below command, replace PID with the number that you had got.
ps -p PID
- Now check out the value under CMD. It will list out the name and location of the app that is currently in possession of your file [in our case, it is the Preview app].
- So go to Launchpad > Others and open Activity Monitor. Then search the app which is currently using your file, double-click to open it and click Quit.
- Once done, retry deleting your file. This time you wouldn’t face any issues.
That’s it. These were the steps to fix the “The operation can’t be completed because the item x is in use” error when trying to delete a file on Mac. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.