How to Delete Locked Files on a Mac
Locking files is useful for controlling who can access or edit a file. Although they are great for security, deleting a locked file on Mac can be troublesome. Fortunately, there are a few possible workarounds to dealing with files that...
Method 1 of 3:
Using Secure Empty Trash
-
How to Delete Locked Files on a Mac Picture 1
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+.
-
How to Delete Locked Files on a Mac Picture 2
Trash the file. Drag the locked file into the trash. -
How to Delete Locked Files on a Mac Picture 3
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 TIPHow to Delete Locked Files on a Mac Picture 4
Gonzalo Martinez
Apple Repair Specialist & President, CleverTechHow to Delete Locked Files on a Mac Picture 5
Gonzalo 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
-
How to Delete Locked Files on a Mac Picture 6
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. -
How to Delete Locked Files on a Mac Picture 7
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. -
How to Delete Locked Files on a Mac Picture 8
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. -
How to Delete Locked Files on a Mac Picture 9
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
-
How to Delete Locked Files on a Mac Picture 10
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. -
How to Delete Locked Files on a Mac Picture 11
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.
-
How to Delete Locked Files on a Mac Picture 12
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
- Delete Files on Mac - Empty Trash or Secure Empty Trash?
- Use Terminal on Mac as FTP or SFTP Client
- 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
- How to recover deleted files on macOS
- How to add trash to permanently delete files on Windows 10/11