I use a Mac device and I love it so much. I always clean it up regularly to remove purgeable space on my Mac through manual means. I take care of my Mac cause it’s very important to me.

Recently, I was cleaning up my Mac device but I cannot empty the Trash. A message pop up as "the operation can’t be completed because the item is locked." and there are some locked files on my Mac device. I want to remove them from it but I can't unlock the file on Mac. How do I delete locked files on Mac?

~Mac Device User

Contents: Part 1. Why Can't You Empty The Trash?Part 2. How to Delete Locked Files On Mac?Part 3. Other Reasons For Being Unable To Empty Your TrashPart 4. Force To Empty Trash on High Sierra Using The TerminalPart 5. Conclusion

Part 1. Why Can't You Empty The Trash?

Some of us want to simply clean up our Mac device to free up more space and enhance our device’s performance. And cleaning up our Mac entails emptying the Trash. However, at one point in time, you might encounter that you cannot empty your Mac device Trash.

Your Mac doesn’t allow you to empty your Trash might be caused by several reasons. One reason would be the files you are trying to delete are still being utilized. Another reason would be the files are actually locked or damaged and needs to be fixed. Some file with names that have special characters in it cannot be deleted as well.

This is because Mac might think that it’s important for the functioning of the system. Another reason for files being unable to be deleted is due to the reason of system integrity protection. In this article, we will tell you how to delete the files depending on the reasons we have stated above. Let’s get started.

Lock Files on Mac

Part 2. How to Delete Locked Files On Mac?

When you tried to delete a file, sometimes it cannot be deleted because Mac says that the file is being used. There are some solutions to this problem that you can implement in order to actually delete the file.

The first thing you should try is to restart the Mac device. This allows you to ensure that all applications have been closed. Even application files that are running in the background that uses the said file you want to quit can be closed from restarting the Mac device.

Another thing you can do is to empty the Trash and be able to delete the files in Safe Mode. Usually, the file is being used because it is utilized by a login or startup item. That’s why you have to open the Mac in Safe Mode. In this way, 3rd party drivers and also startup programs won’t be opened.

Here are the easy steps you can follow in order to delete locked files on Mac in Safe Mode:

  1. Shut down your Mac device, then press the power button again to restart your Mac device.
  2. Press and hold the Shift key during the bootup process. Release your hold on the Shift key when you see the Apple logo on the screen with its progress bar.
  3. Empty your Trash to delete locked files. Then restart the Mac device in order to exit this mode.

Empty Trash to Delete Locked Files on Mac

What if the methods above didn’t work? Well, you can use iMyMac PowerMyMac to delete the files you want in the Trash. It also can remove your purgeable space on Mac to get more space, just click here to check how it works. Below are the steps to use the said software:

Get PowerMyMac Free TrialGet A Free Trial Now!

  1. Download the software and launch it on your Mac.
  2. Click the option named Junk Cleaner on the left side of the screen.
  3. Press the SCAN button to find all junk files.
  4. Once the process is complete, it will show junk files in various categories such as System Logs, Application Cache, System Cache, etc. Select System Trash in this case.
  5. Click the button named CLEAN. Wait until the cleanup process is complete.

Delete System Trash

Advantages of PowerMyMac:

  • It helps you scan your entire Mac device for junk files, unnecessary files, clutter, and old files.
  • You are free to use the application for the first 500 megabytes of data.
  • After it scans your entire Mac device, you are free to preview each file before actually deleting it.
  • The files you preview can be sorted into various categories depending on what you want. These categories include size, date, type, etc.

Part 3. Other Reasons For Being Unable To Empty Your Trash

There are other reasons for not being able to delete the Trash. Below are some things you can do to fix this:

How to Unlock Locked Files on Mac

If your Mac device says that the file is locked, you can follow our guide below to delete the said file. First, you have to ensure that the folder or the file is not actually stuck, After which, right-click the said file or folder. Then, select Get Info. See if it is actually locked. If it is, uncheck the locked option to be able to empty your Trash.

Another reason why a Trash can’t be emptied is due to its file name. The best way to fix this would be to rename the file and try to delete it again.

Delete 'in Use' or Locked Files on Mac

Use Disk Utility To Repair Your Disk

Sometimes, the file you want to delete is damaged, then this may cause file is locked for editing on Mac. To fix this, would need extra effort on your part. Here’s how to do it step-by-step:

  1. Shut down your Mac device first.
  2. Open your Mac device again while holding the keys Command + R while it is starting up. This will enter the Mac device in Recovery Mode.
  3. Release the hold on these keys once the Apple Logo including its progress bar shows up.
  4. Select Disk Utility > Continue.
  5. Select the disk where the file you wish to remove is located.
  6. Press First Aid in order to repair the damaged disk.


System Integrity Protection Causes

The rootless feature is also called SIP or System Integrity Protection. This was provided on Mac starting version 10.11 in order to prevent attacks from malware that modify protected folders and files on your Mac device.

In order to delete files that are protected by the SIP, you simply have to temporarily deactivate the SIP. This is how you can deactivate the SIP in versions of the Mac OS X El Capitan or higher:

  1. Open your Mac in Recovery Mode.
  2. Release the hold on these keys once the Apple Logo including its progress bar shows up.
  3. Within the macOS Utilities Window, select Terminal.
  4. Within the Terminal, enter the following: csrutil disable; reboot
  5. Press the Enter button. Now, a message will display that the SIP is deactivated and you need to restart your Mac device.
  6. Allow the Mac device to automatically reboot itself.

After this, you will be able to empty your Trash. It is suggested that you activate your SIP to ensure that your Mac device is protected. The steps to do so is the same as the one we stated before. However, this time, you will enter the following command: csrutil enable. After you do so, you have to reboot your Mac device for the said command to be activated.

Part 4. Force To Empty Trash on High Sierra Using The Terminal

You can use the Terminal to empty the Trash by force. You must take caution though as it might erase your data. Here are the steps to do so:

  1. Launch Terminal and type the following: sudo rm -r
  2. Put a space after the -r
  3. Ensure that the space is included. Launch the Trash.
  4. Select all folders and files within the Trash.
  5. Drag these towards the Terminal and drop them. Now, the location of each file and each folder you have dropped will be displayed on the Terminal’s window.
  6. Press Enter button.

If you want to do it in Mac OS X, you have to type out the following: sudo rm -rf ~/.Trash/

Instead of typing out sudo rm -r

Drag File to Trash on Terminal

Part 5. Conclusion

After you have read this guide, you will know now how to empty the Trash that doesn’t allow you to. You will also be able to unlock multiple files Mac and delete locked files on Mac.

For a safer way of deleting files on your Mac and cleaning your device, you can use PowerMyMac. This is a great tool that helps you find clutter and junk files and delete them with a few clicks.