How to Delete Locked Files on a Mac
Method 1 of 3:
Using Secure Empty Trash
- Know the difference between trash and 'secure' trash. Secure Empty Trash is a security measure designed by Apple to make sure sensitive files have their indexing removed from the hard drive and the space they occupied overwritten. Due to the way solid state hard drives store data, this method is less reliable on solid state drives, and thus is being phased out by Apple.
- The Secure Empty Trash option has been removed in OSX 10.11+.
- Trash the file. Drag the locked file into the trash.
- Empty the trash securely. Open the trash in the finder and select 'File > Secure Empty Trash'. You can also access this with 'Ctrl + click > Secure Empty Trash'. The file should delete without error.EXPERT TIP
Gonzalo Martinez
Apple Repair Specialist & President, CleverTechGonzalo Martinez
Apple Repair Specialist & President, CleverTechAnother option is using the application App Cleaner. If you don't use secure delete, you can drop your application onto App Cleaner, which will search all the connected files and remove them. For example, you can remove apps like Microsoft Word and all their data by dragging the application onto App Cleaner.
Method 2 of 3:
Altering File Permissions
- Check the file's lock status. Select the file, go to 'File > Get Info'. A checkbox labeled 'Locked' will tell you the file's current status. If the box is not greyed out, simply uncheck the box and try deleting the file again. If the box is greyed out it means you do not have the proper permissions for the file.
- Access the inspector. Press and hold ⌥ Option and go to 'File > Show Inspector' (holding the options key will change 'Get Info' into 'Show Inspector' in the menu). In this menu press the triangle next to 'Ownership and Permissions' to expand.
- Unlock the options. From here you can view the file permissions, but to change them you need to press the lock icon. This will prompt you for your administrator password.
- Change the permissions for unlocking. Press 'You Can' and select the option 'Read and Write'. With this change the checkbox next to 'Locked' should no longer be inaccessible. Deselect the checkbox and delete the file like normal.
Method 3 of 3:
Using the Terminal
- Launch the terminal. 'Go to Applications > Utilities > Terminal' to open. The terminal allows you to execute commands to the operating system with code. The 'sudo' tag is used to grant root access. After entering a command with it, you may be prompted for your account's administrator password to proceed with the command.
- Change the lock status. Enter 'sudo chflags nouchg [path to the file]'. This should force toggle the files locked status.
- For example: 'sudo chflags nouchg ~/Applications/Microsoft Word/test.doc'.
- You can also drag and drop the target file in the terminal window to automatically enter the file path.
- Force delete the file. If all else fails, another terminal command can force file deletion. Enter 'sudo rm -r [path to the file]'. In most cases, this command will delete the file once granted administrator permission with the password.
3.5 ★ | 2 Vote
You should read it
- How to Create and Edit Text File in Linux by Using Terminal
- This is one of the smartest trash bins in the world
- How to fix errors cannot clean up Trash on Mac
- 6 interesting terminal commands on Mac
- How to use Terminal on a Mac
- The deleted file is not in the trash, why and how to handle it?
- How to recover, retrieve deleted files in trash
- 8 best free Terminal Emulator apps for Android
May be interested
- How to delete 'iOS Files' which is taking up your Mac's memory?do you have some mysterious 'ios files' taking up too much of your valuable mac memory? maybe you do not need them anymore, the article below helps you completely eliminate those files.
- Guide to delete files not to delete, fix errors when deleting filesinstructions for deleting files from deleting and fixing errors when deleting files - there are many cases when you want to delete a file, but even after turning off its operation, you still cannot delete it by normal deletion methods.
- 'Unlock' file in Windowssuppose you want to edit a file, you may want to name it, move it to another location or delete it completely. however, you have a problem when editing, windows will notify you that another process has locked your file. so what to do?
- How to delete files and folders on Dropboxafter a long time using dropbox leads to more and more storage space on dropbox. you should clean up dropbox, delete files or folders that are no longer in use.
- How to Delete Temporary Files and Delete Prefetch Files from Your Computerif you need to free up some space on your computer, you may be searching for files to delete. temp files are created when windows shuts down in an irregular way, and your computer doesn't need them to function, so these are good...
- How to add trash to permanently delete files on Windows 10/11do you want a recycle bin on your windows 10 or 11 desktop that actually deletes files that are dragged into it and cannot be recovered? the good news is that you can do this using free file wiper and multi trash.
- How to Delete Read-Only Files on Linuxthere are several ways to help you delete files read-only on linux. if it's a file you own, you can change the file permissions or use the sudo command to delete the original file. however, if you cannot delete files with write permissions (or see a 'read only file system' error message), you need to change the drive with the appropriate permissions. this article will show you how to delete read-only files on any linux distribution, including ubuntu and linux mint.
- How to view recently deleted files on Windows 10?usually when you delete any file on a windows 10 computer by right-clicking on the file and selecting delete or selecting the file then pressing the delete key, then the file will be moved to recycle bin. or another way to permanently delete files is to press shift + delete, and windows will move these files from recycle bin.
- How to Delete Undelete Filesthis is an article showing how to delete regular files that cannot be deleted on your computer. in most cases, files that cannot be deleted are being used by some program or service; you can solve the problem by starting your computer in safe mode to stop most programs and services. if the file is corrupted or the computer reports that the file cannot be found, repairing the hard disk error may fix the problem. on android phones and tablets, you can use third-party apps to delete files. however, the article does not instruct on deleting system files, as this may cause the computer to crash.
- How to batch delete files on Windows 10deleting anything more than a few files with file explorer can become a lengthy process. when it comes to batch deletion of files on windows 10, you have a few options.