iMyMac / Mac Cleaner / Deleting Locked Files On Mac And Solving The Problem Of Being Unable To Empty Trash

Deleting Locked Files On Mac And Solving The Problem Of Being Unable To Empty Trash

By Marice | Lasted Updated 2018-10-18 08:09:21

I use a Mac device and I love it so much. I always clean it up regularly 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. There are some locked files on my Mac device and I want to remove them from it. How do I do this?

~Mac Device User

Part I: Introduction of Remove Locked Files

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.

It’s an easy thing to do, right? Emptying the Trash is such an easy thing. However, sometimes this is not possible. Your Mac doesn’t allow you to empty your Trash. This 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 II: File Is Actually Being Used

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 steps you can follow in order to open the Mac device in Safe Mode:

Step 01 -  Shut down your Mac device.

Step 02 - Press the power button again to open your Mac device.

Step 03 - Press and hold the Shift key during the bootup process.

Step 04 - Release your hold on the Shift key when you see the Apple logo in the screen with its progress bar.

Step 05 - Empty your Trash.

Step 06 - Restart the Mac device in order to exit this mode.

What if the methods above didn’t work? Well, you can use iMyMac’s Mac Cleaner to delete the files you want in the Trash. Below are the advantages, disadvantages, and steps to use the said software:

Advantages:

*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. This means you get a free trial. At least, you get to try out the software first before actually paying out of your pocket.

*After it scans your entire Mac device, you are free to preview each file before actually deleting it. In this way, you know that you are actually deleting the right thing. Say bye bye to mistakenly delete files.

*The processes of scanning and cleaning up your Mac device can be implemented with only a few clicks of the button.

*The files you preview can be sorted into various categories depending on what you want. These categories include size, date, type, etc.

*You get free email support and one on one support from the iMyMac. This is to help you learn more about the software and it helps you troubleshoot problems in case you encounter some.

Disadvantages:

*We can’t find any. 

Mac Cleaner

Here’s how to use the said Mac Cleaner step by step:

 

Step 01 - Download the software from the official website.

Step 02 - Launch the said software within your Mac device. The main interface will show you updates on the status of various parts of the system.

Step 03 - Visit the left-hand side of the screen. Click the option named Junk Files.

Step 04 - Press the Scan button to start screening your entire Mac device for junk files. Wait until the entire process is complete.

Step 05 - Once the process is complete, it will show junk files in various categories such as User Logs, Application Cache, System Logs, System Cache, etc. Select a category you want.

Step 06 - Select the data you want to delete per category. If you want, you can preview the files first.

Step 07 - Click the button named Clean.

Step 08 - Confirm that you actually want to delete these files. Wait until the cleanup process is complete.  

Step 09 - Go back to the left-hand side of the screen and repeat steps 01 to 08. However, step 03 would be different. In this case, you have to select Large & Old Files OR Clutter to remove other unnecessary files in your system.

Clean Junk Files

Part III: 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:

Unlock A File And Rename A File

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.  

Use Disk Utility To Repair Your Disk

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

Step 01 - Shut down your Mac device first.

Step 02 - 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.

Step 03 - Release the hold on these keys once the Apple Logo including its progress bar shows up.

Step 04 - Select Disk Utility.

Step 05 - Select Continue.

Step 06 - Select the disk where the file you wish to remove is located.

Step 07 - Press First Aid in order to repair the damaged disk. 

Part IV: System Integrity Protection Causes You To Be Unable To Empty The Trash

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:

Step 01 - Shut down your Mac device first.

Step 02 - 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.

Step 03 - Release the hold on these keys once the Apple Logo including its progress bar shows up.

Step 04 - Within the macOS Utilities Window, select Terminal.

Step 05 - Within the Terminal, enter the following: csrutil disable; reboot

Step 06 - Press the Enter button. Now, a message will display that the SIP is deactivated and you need to restart your Mac device.

Step 07 - 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 V: 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:

Step 01 - Launch Terminal.

Step 02 - Type the following: sudo rm –R

Step 03 - Put a space after the –R

Step 04 - Ensure that the space is included. Launch the Trash.

Step 05 - Select all folders and files within the Trash.

Step 06 - 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.

Step 07 - 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 VI: 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 delete locked files on Mac.

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

iMyMac Software
Free Download and Try iMyMac
The most powerful and useful 7-in-1 Mac Software in 2018

The Useful Tips & Trick

Clean MacBook
Clean Browser
Mac Uninstall
Download to try Mac Cleaner!
back to top
success

Subscription is successful !

error

Subscription failed !