Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Delete Files on Mac That Won't Delete

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If a file on your Mac refuses to move to the Trash, the most common fix is to quit the app that's using it, then try again. If that doesn't work, you can force the deletion using Terminal's rm command or check for locked files and permission issues. Below is a step-by-step guide covering all the reliable methods.

What You'll Need

  • Your Mac with the problematic file(s)
  • Administrator access (you'll need to enter your password for some steps)
  • Optional: a backup of any important data (just in case)

Step-by-Step

Method 1: Quit the App Using the File

  1. Try to move the file to the Trash by dragging it there or right-clicking and selecting "Move to Trash." If it doesn't work, note the error message.
  2. If the file is open in an app (like a Word document or a video in QuickTime), quit that app first. You can right-click the app's icon in the Dock and choose "Quit," or press Cmd + Q while the app is active.
  3. Try deleting the file again.

Method 2: Empty Trash While Holding Option

  1. Right-click the Trash icon in the Dock.
  2. Hold the Option key on your keyboard. The menu will change to show "Empty Trash" (without the Option key it says "Empty Trash..." with a confirmation dialog).
  3. Click "Empty Trash" while still holding Option. This bypasses the confirmation dialog and may delete files that are stuck due to minor issues.

Method 3: Check If the File Is Locked

  1. Right-click the file and select "Get Info" (or press Cmd + I).
  2. In the Info window, look for the "Locked" checkbox near the bottom. If it's checked, uncheck it.
  3. Close the Info window and try deleting the file again.

Method 4: Reset Permissions (for files in your home folder)

  1. Open System Settings (or System Preferences on older macOS) and go to "Privacy & Security."
  2. Scroll down and click "Full Disk Access."
  3. If your user account is listed, make sure it's enabled. If not, click the lock icon, enter your password, and add your account.
  4. Restart your Mac and try deleting the file again.

Method 5: Use Terminal to Force Delete

  1. Open Terminal (found in Applications > Utilities).
  2. Type rm -rf followed by a space. Warning: This command permanently deletes files without sending them to Trash. Be absolutely sure you want to delete the file.
  3. Drag the file from Finder into the Terminal window. The file's path will appear after the command.
  4. Press Enter. You may be asked for your password (type it, but it won't show as you type).
  5. If the file is deleted, you're done. If you get a "Permission denied" error, try prepending sudo to the command: sudo rm -rf and then drag the file again. This runs the command with administrator privileges.

Method 6: Delete in Safe Mode

  1. Restart your Mac and immediately hold the Shift key until the login window appears (on Apple Silicon, hold the power button until "Loading startup options" appears, then select your disk and hold Shift).
  2. Log in. Safe Mode prevents some background processes from running, which may free up the file.
  3. Try deleting the file normally. Afterward, restart your Mac normally.

Common Mistakes

  • Not quitting all apps: Sometimes the file is used by a background process or a helper app (like a cloud sync service). Check Activity Monitor for processes that might be using the file.
  • Using rm without understanding the path: Dragging the file to Terminal is safer than typing the path manually, but double-check the path before pressing Enter.
  • Forgetting about iCloud Drive: If the file is stored in iCloud Drive, it may be syncing. Turn off iCloud Drive temporarily in System Settings > Apple ID > iCloud, then try deleting.
  • Deleting system files: If the file is in /System or /Library, it may be protected by macOS. Do not force-delete system files unless you know exactly what you're doing.

Tips

  • Always try the simplest methods first: quit the app, then empty Trash with Option.
  • If the file is on an external drive or a USB stick, try disconnecting and reconnecting it before deleting.
  • If the file is corrupted, you can try renaming it (right-click > Rename) and then deleting.
  • For files that are "in use" by a system process, a restart often clears the lock.
  • Keep regular backups (Time Machine) so you can recover if you accidentally delete something important.

Troubleshooting

If the file still won't delete after trying the methods above:

  • Check for errors in Terminal: If you get "Operation not permitted," it may be a System Integrity Protection (SIP) protected file. Do not disable SIP just to delete a file; instead, check if the file is part of macOS and leave it alone.
  • Use Disk Utility First Aid: Open Disk Utility (from Applications > Utilities), select the disk, and click "First Aid" to check for disk errors that might cause files to be stuck.
  • Restart in Recovery Mode and use Terminal: Restart your Mac and hold Cmd + R (Intel) or hold the power button (Apple Silicon) to enter Recovery. Open Terminal from the Utilities menu and use the rm command there. This can bypass some permission issues.
  • If all else fails, create a new user account and try deleting from there: Go to System Settings > Users & Groups, add a new administrator account, log into it, and try to delete the file. If it works, the issue is with your user account's permissions.

Frequently Asked Questions

Why does a file say "The operation can’t be completed because the item is in use"?

This means an app or system process is currently using the file. Quit the app or restart your Mac to release the lock.

Can I delete a file that is locked?

Yes, but you need to unlock it first via Get Info. If it's locked by a system process, you may need to use Terminal with rm after unlocking.

Is it safe to use the rm -rf command?

It is safe if you type the correct path. However, it bypasses the Trash and permanently deletes the file, so double-check the path. Never use rm -rf on system directories.

What if the file is on an external drive and won't delete?

Try ejecting the drive and reconnecting it. If the drive is formatted as NTFS (Windows), your Mac may have read-only access. Use a Mac-compatible format (like APFS or exFAT) to delete files.

Can I delete files from the macOS system folder?

Files in /System are protected by SIP. You should not delete them unless you are certain they are not needed. Attempting to do so may cause system instability.

What does "The file is locked" mean?

It means the file has a flag that prevents modification or deletion. You can uncheck the Locked box in Get Info, but some files (like system files) may have the flag set by macOS.