Delete Corrupted Files on Mac: 6 Ways That Work
To delete corrupted files on a Mac, you typically use Finder, Trash, or Terminal, depending on how stubborn the file is. This article covers six methods, from the simplest drag-to-Trash approach to force-deleting files that refuse to move, plus what to do when a file is locked or in use.
What Makes a File Corrupted on macOS
A corrupted file is one whose data no longer matches its expected structure, so macOS can’t read it properly. This can happen from a sudden power loss during a write, a failed download, a crash of the app that created it, or a bad sector on the disk. Common signs include error messages like “The file could not be opened,” “The operation can’t be completed because the item is in use,” or a file that shows 0 bytes in Get Info even though it should have content. Corruption is different from a file being locked or having wrong permissions, though those can also prevent deletion.
Method 1: Drag to Trash (The Normal Way)
Start with the simplest approach. Click the file in Finder and drag it to the Trash icon in the Dock, or select it and press Command + Delete. Then empty the Trash by right-clicking the Trash icon and choosing “Empty Trash,” or press Shift + Command + Delete. If the file is corrupted but not locked, this usually works. If you get an error saying the file is in use, close any app that might have it open and try again.
Method 2: Force Delete with Option Key
When a file is locked or you get a “The item is in use” error, hold down the Option key while clicking the Trash icon in the Dock. The menu will change from “Empty Trash” to “Force Empty Trash.” Click that. This bypasses the usual checks and deletes the file even if it’s locked or the system thinks it’s in use. Be careful: this permanently deletes the file without asking for confirmation, so make sure you don’t need it.
Method 3: Delete via Terminal (For Stubborn Files)
If Finder refuses to delete the file, Terminal gives you more control. Open Terminal (in Applications > Utilities) and type the following, then press Return:
rm -f ~/Desktop/filename.ext
Replace ~/Desktop/filename.ext with the actual path to the file. A quick way to get the path is to drag the file into the Terminal window after typing rm -f – it will fill in the full path automatically. The -f flag means “force,” so it won’t ask for confirmation. For a folder, use rm -rf instead. Be absolutely sure you have the right path, because there is no undo.
Method 4: Delete a File That’s “In Use”
If you get “The operation can’t be completed because the item is in use,” the file is open by some process. First, quit all apps that might use it. If that doesn’t work, check Activity Monitor (Applications > Utilities) and look for any process that might have the file open. If you can’t identify it, restart your Mac and try deleting immediately after login, before opening any apps. If the file is on an external drive, unmount and remount the drive first.
Method 5: Delete Corrupted Files from an External Drive
If the corrupted file is on an external drive, the drive might have errors that prevent deletion. Open Disk Utility (Applications > Utilities), select the drive, and click First Aid. This checks and repairs the drive’s file system. After First Aid completes, try deleting the file again. If the drive is formatted as NTFS (Windows), macOS can only read it, not delete files – you’d need to use a Windows machine or a third-party NTFS driver.
Method 6: Delete a Corrupted App or System File
For a corrupted app, drag it from the Applications folder to Trash, then empty the Trash. If the app is currently running, quit it first. For corrupted system files, you generally shouldn’t delete them manually – they may be part of macOS. Instead, try reinstalling macOS or using First Aid in Disk Utility. If a file is locked by System Integrity Protection (SIP), you can’t delete it even with Terminal, and you shouldn’t try to disable SIP just to remove a file.
What to Do If You Can’t Delete a File at All
If none of the above works, the file might be on a damaged disk. Try these steps in order:
- Restart your Mac and try again immediately.
- Run First Aid in Disk Utility on the startup disk.
- Boot into Safe Mode (hold Shift at startup) and try deleting there.
- If the file is on an external drive, try a different cable or port.
- As a last resort, back up everything else and erase the drive, then restore.
If the file is on a network drive or cloud sync folder (like iCloud Drive), try removing it from the web interface instead.
Frequently Asked Questions
Will deleting a corrupted file damage my Mac?
No. Deleting a corrupted file only removes that file. It doesn’t affect other files or the system, as long as you’re not deleting a system file that macOS needs. If you’re unsure, move the file to Trash and keep it there for a few days before emptying.
How do I know if a file is corrupted or just has the wrong app?
Try opening the file with a different app (right-click > Open With). If it opens fine in another app, it’s not corrupted – it’s just associated with the wrong program. If no app can open it, and Get Info shows 0 bytes or an error, it’s likely corrupted.
Can I recover a corrupted file instead of deleting it?
Sometimes. If the file is a document, try opening it in a text editor to see if any readable text remains. For photos or videos, some apps like Preview or VLC can often open partially corrupted files. If you have Time Machine, you can restore an earlier version. But if the file is truly corrupted, deletion is often the only option.
Why does my Mac say “The file is in use” when it isn’t?
This can happen if an app crashed but left a background process running. Check Activity Monitor for any process that might have the file open, or restart your Mac to clear all background processes. Sometimes the file is on a network drive and the connection is stale – reconnect to the drive.
Is it safe to use Terminal to delete files?
Yes, if you’re careful. The rm command is powerful and permanent, but it’s safe when you type the correct path. Always double-check the path before pressing Return. If you’re not comfortable with Terminal, use the Finder methods first.
What if the corrupted file is in the Trash and won’t empty?
Try the Force Empty Trash method (hold Option while clicking Trash). If that fails, restart your Mac and try again. If it still won’t empty, the file might be on a damaged disk – run First Aid in Disk Utility.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.