Best Reviews logo
Best Reviews may receive compensation for its content through paid collaborations. See how we sustain our work & review products.
How to Remove Files That Cannot Be Deleted

How to Remove Files That Cannot Be Deleted

By István F.István F. Verified by Adam B.Adam B. Last updated: September 12, 2024 (1)
Table of contents

Deleting a file or folder from a Mac is as easy as hitting the Command + Delete keys, but on rare occasions stubborn files may refuse to be deleted. The oddest warning message displayed in such cases is: “The item ‘filename.xxx’ can’t be moved to the Trash because it can’t be deleted.”

As you can see, this warning message isn’t much help here, so it could probably simply be a bug related to Finder. Fortunately, solving this issue is pretty easy: just quit and relaunch Finder and you should be able to finally move that stubborn file to the trash.

To achieve this you’ll need to Force Quit the Finder app either by pressing the Command + Shift + Escape keys or Option + Right click on the Finder icon in the Dock.

Best Mac optimization software of 2024

40% Discount on CleanMyMac X
CleanMyMac X logo
Switch your current Mac optimizer or antivirus for CleanMyMac X, and the company will offer you a tasty 40% discount.
Save 40% on CleanMyMac X
Editor's choice
CleanMyMac X logo
Editor's rating:
(4.5)
User-friendly dashboard
Effective scanning and cleaning options
Various maintenance tools
Built-in malware remover
All-around protection
MacKeeper logo
Editor's rating:
(4)
Personalized remote assistance
Unique optimization tools
Anti-theft tracking
Built-in antivirus
Beginners
MacBooster logo
Editor's rating:
(3.5)
Fast scanning
User-friendly UI
Virus and malware scan
Great cleaning features
Businesses
CCleaner for Mac logo
Editor's rating:
(4)
Fast scans and cleaning
Full customization
Extensive free version
Affordable

Why does finder have issues with that file?

The reason for getting this error may vary, but the most likely cases are as follows:

  1. The file is in use by an application or system process.
  2. The file is locked.
  3. The user doesn’t have permission to delete the file.

4. The file is damaged or corrupted, and the system is having a hard time finding it on the disk drive.

What to do if relaunching finder doesn’t solve the issue

The first thing to do in this situation is to quit all applications that might be using that specific file, even those that you might not think are using it. To do this, simply press the Command + Q keys after activating the application, or open Activity Monitor and kill all the processes you think might be using the file.

If the file is locked, the user doesn’t have permission to remove the file or it is damaged, then it is best to first check the file permissions. Select the file and press the Command + I keys or right-click the file and select “Get Info”.

To modify permissions in macOS High Sierra, click on the lock icon located in the bottom right of the Get Info window, at which point you’ll need to enter the admin password to initiate the change to the file permissions. In this section you’ll see who can read and write the file, and if your user doesn’t have this privilege then select that option.

To manually unlock files via Terminal, type the following command:

chflags nouchg [name of file]

After the permissions change, you’ll be able to delete the file either by dragging it to the trash or via the Terminal command “sudo rm –R” followed by the location of the file.

Force empty trash

On rare occasions you might need to force the trash to be emptied. One method is to quit all active apps and then securely empty the trash by holding down the Command key and right-clicking on the trash icon. Mac users with SSDs won’t see the “Secure Delete” option, however.

Advanced users might prefer emptying the trash via a Terminal command. Don’t use the very powerful “sudo rm -rf” command, because it will erase everything without warning. Use it only if you know what you are doing. Instead, we recommend using the following, safer method of removing files using Terminal:

  1. Type “cd ~/.Trash” to change the directory to the trash folder.
  2. Confirm that you are browsing the right directory by typing “ls”. This will display all files located in the trash.
  3. Delete the specific file by typing the following command: rm [filename.xxx]. If for some reason that doesn’t work, then instead use sudo -rf* [filename.xxx]. This will require the admin password, but the idea is that it will definitely force the selected file to be removed.

As always, use Terminal commands with care and only when you are absolutely sure of what you are doing, otherwise the risk of deleting something significant is pretty high.


Best mac optimization software of 2024

Editor's choice
CleanMyMac X logo
Editor's rating:
(4.5)
User-friendly dashboard
Effective scanning and cleaning options
Various maintenance tools
Built-in malware remover
All-around protection
MacKeeper logo
Editor's rating:
(4)
Personalized remote assistance
Unique optimization tools
Anti-theft tracking
Built-in antivirus
Beginners
MacBooster logo
Editor's rating:
(3.5)
Fast scanning
User-friendly UI
Virus and malware scan
Great cleaning features
Businesses
CCleaner for Mac logo
Editor's rating:
(4)
Fast scans and cleaning
Full customization
Extensive free version
Affordable
User Feedback
  1. Gibron Williams

    An easy fix for deleting a file on mac that I could not put in the Trash or delete… simply “relaunched” the Finder and the file was gone.

 Leave a reply

Your email address will not be published. Required fields are marked *


Best Reviews

Best Reviews may receive compensation for its content through paid collaborations and/or affiliate links. Learn more about how we sustain our work and review products.

©2012-2024 Best Reviews, a clovio brand – All rights reserved
Privacy policy · Cookie policy · Terms of use · Partnerships · Contact us