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

  1. How to Delete Locked Files on a Mac Picture 1How 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.
    1. The Secure Empty Trash option has been removed in OSX 10.11+.
  2. How to Delete Locked Files on a Mac Picture 2How to Delete Locked Files on a Mac Picture 2
    Trash the file. Drag the locked file into the trash.
  3. How to Delete Locked Files on a Mac Picture 3How 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 TIP
    How to Delete Locked Files on a Mac Picture 4How to Delete Locked Files on a Mac Picture 4

    Gonzalo Martinez

    Apple Repair Specialist & President, CleverTech
    Gonzalo Martinez is the President of CleverTech, a tech repair business in San Jose, California founded in 2014. CleverTech LLC specializes in repairing Apple products. CleverTech pursues environmental responsibility by recycling aluminum, display assemblies, and the micro components on motherboards to reuse for future repairs. On average, they save 2 lbs - 3 lbs more electronic waste daily than the average computer repair store.
    How to Delete Locked Files on a Mac Picture 5How to Delete Locked Files on a Mac Picture 5
    Gonzalo Martinez
    Apple Repair Specialist & President, CleverTech

    Another 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

  1. How to Delete Locked Files on a Mac Picture 6How 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.
  2. How to Delete Locked Files on a Mac Picture 7How 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.
  3. How to Delete Locked Files on a Mac Picture 8How 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.
  4. How to Delete Locked Files on a Mac Picture 9How 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

  1. How to Delete Locked Files on a Mac Picture 10How 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.
  2. How to Delete Locked Files on a Mac Picture 11How 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.
    1. For example: 'sudo chflags nouchg ~/Applications/Microsoft Word/test.doc'.
    2. You can also drag and drop the target file in the terminal window to automatically enter the file path.
  3. How to Delete Locked Files on a Mac Picture 12How 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