How to Delete Files from Your Mac that Won’t Delete

How Delete Any File Mac Macos

Have you ever tried to drag a file to your Mac’s Trash, only to receive an error message? Maybe the file is in use, locked, or you don’t have permission to edit the file in question. Here we cover all the ways you can delete files on your Mac that won’t delete and refuse to get in the bin.

1. An application is using this file

You cannot delete a file if an application is using it! If your Mac is displaying the “file in use” error, you need to figure out which application has a hold over the file and close that application.

If you only have a handful of applications open, this may be as simple as shuffling through the various application windows. Alternatively, you can see a list of all active applications in the “Force Quit” window:

1. Click the “Apple” logo in your Mac’s menu bar.

2. Select “Force Quit.”

You can now review all the applications that are running on your Mac.

If you spot an application that could be responsible for the “File in use” error, you can close that application normally. Alternatively, you can select the application in the “Force Quit” popup and then click the “Force Quit” button. Note that if you opt for the latter, you’ll lose any unsaved work within the application.

Once you’ve closed the offending application, try deleting the file again. It should now vanish without any issue!

2. The file is locked

When a file is locked, you’re unable to make any changes to that file. This includes deleting it.

You’ll need to unlock this file before deleting it:

1. Control-click the file you want to unlock.

2. Select “Get Info.”

3. Click to expand the “General” section.

4. Find the “Locked” checkbox and deselect it.

You cannot delete a locked file.

Alternatively, you can unlock a file using your Mac’s Terminal.

1. Open the Terminal (Applications -> Utilities -> Terminal). In the Terminal window, type the following command:

This file should now be unlocked, and you can go ahead and delete the file, as normal.

3. You don’t have permission to edit the file

Sometimes you may hit the “Delete” key only to encounter a “You don’t have permission to edit this file” message.

Thankfully, you can give yourself permission:

1. Control-click the file in question.

2. Select “Get Info.”

3. Click to expand the “Sharing & Permissions” section. You’ll see a list of all the user accounts registered with your Mac.

You can assign yourself "Read & Write" permissions for any file.

4. To give yourself permission to edit this file, click the little padlock icon.

5. When prompted, enter your username and password.

6. Find your username in the list, click the accompanying set of arrows, and then select “Read & Write.”

You can lock and unlock a file, using macOS' "Get Info" window.

You should now have permission to edit this file, including dragging it to the Trash!

4. None of the above fixes work? Try Force Delete

If all else fails, you can force-delete the file using a Terminal command. Just be aware that force-delete doesn’t send the file to the Trash – it permanently and immediately deletes the file in question. If you realize you’ve made a terrible mistake, there’s no way to recover the file.

This technique can also delete files you wouldn’t normally be able to delete – and sometimes Apple has a very good reason for protecting certain files! Force-delete is a useful technique but should be used with caution.

To force-delete a file, open your Mac’s Terminal (Applications -> Utilities -> Terminal) and type the following command:

Taking out the Trash

Have you managed to banish a file to the Trash, but now it’s stuck there, refusing to let go?

If you’re getting an error message every time you try to empty the Trash, there are a few tricks you can try.

1. Close all applications

An application may be using one of the files inside your Mac’s Trash.

You can resolve this issue by selecting the “Apple” logo in your Mac’s menu bar, choosing “Force Quit … ” and then closing the application in question.

If you’re unsure which application is interfering with the “Empty Trash” command, you can always restart your Mac, which will close all applications.

When your Mac restarts, make sure you empty the Trash before launching any applications!

2. Make sure all files are unlocked

If the Trash contains a file that’s locked, then this can prevent you from emptying the Trash successfully.

If the Trash only contains a handful of files, you may be able to check each of these files manually by Control-clicking each file and then selecting “Get Info.” If you discover a locked file, you can unlock it using the steps listed earlier in this article.

3. Force-delete stubborn files

If you suspect that a particular file may be preventing you from emptying the Trash, you can forcefully delete this file while it’s inside the Trash:

1. Open your Mac’s Trash.

2. Ctrl + click the file you believe may be causing the problem.

3. Select “Delete Immediately.”

Rinse and repeat for any other files you believe may be affecting your ability to empty the Trash.

Now that you have successfully deleted a file that won’t delete initially, it is good to delete an autosave file version to free up storage space. You should also locate and delete duplicate files on your Mac.


One comment

  1. “When your Mac restarts, make sure you empty the Trash before launching any applications!”

    That can be difficult, since most people’s Macs are configured to automatically start a bunch of programs when they boot. Not to mention that when you restart a Mac without shutting down programs that are running (web browser, e-mail client, etc.), macOS does its best to restart all those programs once it’s finished booting.

    But that shouldn’t really matter. When macOS shuts down programs in order to restart, links between locked files and the program that’s locked them are broken, and the files should be easily deletable once macOS has finished booting.

    FYI, you only mentioned restarting the Mac as a resolution for Trash problems, but it’s also a possible solution for deleting other locked files as well. In fact, it should be tried *before* force-deleting files: restarting the Mac does a controlled shutdown of the programs, breaking any locks they have on files, whereas force-deleting a file rips it away from the program having a hold on it…and some programs respond badly to having that done; it’s not unknown for such programs to cause even worse problems :-(

    Force-deleting a file, or force-quiting a program, should be the absolute last thing tried to resolve a problem…there’s a reason why one has to jump through hoops to do either.

Leave a Comment

Yeah! You've decided to leave a comment. That's fantastic! Check out our comment policy here. Let's have a personal and meaningful conversation.