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. Picture 1 of How to Delete Locked Files on a Mac
    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. Picture 2 of How to Delete Locked Files on a Mac
    Trash the file. Drag the locked file into the trash.
  3. Picture 3 of How to Delete Locked Files on a Mac
    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
    Picture 4 of How to Delete Locked Files on a Mac

    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.
    Picture 5 of How to Delete Locked Files on a Mac
    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. Picture 6 of How to Delete Locked Files on a Mac
    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. Picture 7 of How to Delete Locked Files on a Mac
    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. Picture 8 of How to Delete Locked Files on a Mac
    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. Picture 9 of How to Delete Locked Files on a Mac
    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. Picture 10 of How to Delete Locked Files on a Mac
    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. Picture 11 of How to Delete Locked Files on a Mac
    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. Picture 12 of How to Delete Locked Files on a Mac
    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.
Update 04 March 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile