Download ArticleDownload Article

Do you have a file on your Mac that you are unable to delete? It's possible the file may be locked. You can easily unlock a file using the Finder, and some applications allow you to lock and unlock a file from within the app the file is associated with. This How.com.vn teaches you how to delete locked files on a Mac.

Method 1
Method 1 of 5:

Unlocking and Deleting a File Using Finder

Download Article
  1. How.com.vn English: Step 1 Open the Finder icon.
    It has an icon that resembles a blue and white smiley face. Click the Finder icon in the Dock at the bottom of the screen to open the Finder.[1]
  2. How.com.vn English: Step 2 Navigate to the file you want to unlock.
    Use the Finder to navigate to the file you want to unlock.
    Advertisement
  3. How.com.vn English: Step 3 Press and hold ⌘ Command and click the file you want to unlock.
    This displays a context menu next to the file you want to unlock.
    • Alternatively, you can right-click the file, if your mouse or trackpad has a right mouse button.
    • If you want to select multiple files, hold Shift and click all the files you want to select.
  4. How.com.vn English: Step 4 Click Get Info.
    It's in the context menu that appears when your Command-click (or right-click) a file or folder.[2]
    • If you have multiple files selected, hold Option and click Show Inspector instead.
  5. Step 5 Uncheck the box next to "Locked."
    It's the last box below the "General" heading. This unlocks the file.[3]
    • If you don't see the checkbox next to "Locked," click the arrow icon () next to "General" to expand the General heading.
    • If you are not signed in as an Administrative account, you may be asked to enter an administrative password. If asked to do so, enter an administrative password and press Enter.
  6. How.com.vn English: Step 6 Drag the file to the Trash.
    It's the white icon that resembles a trashcan at the bottom of the screen in the Dock. Drag and drop the file into the Trash to delete the file. Now that the file is unlocked you should be able to do so without any problems.
    • A locked file prevents the file from being renamed or modified. It typically does not prevent a file from being deleted, but it does ask you to confirm if you want to delete the file. If you are asked if you are sure you want to move the file to the trash, click Continue to do so.
  7. How.com.vn English: Step 7 Empty the Trash.
    To empty the Trash, right-click (or Command-click) the Trash icon in the Dock and click Empty Trash. This permanently deletes all files in the Trash.[4]
    • Be sure you really want to delete the file before emptying the Trash. Once the Trash has been Emptied, you cannot recover the file(s).
  8. Advertisement
Method 2
Method 2 of 5:

Changing File Permissions

Download Article
  1. How.com.vn English: Step 1 Open the Finder icon.
    It has an icon that resembles a blue and white smiley face. Click the Finder icon in the Dock at the bottom of the screen to open the Finder. If a file is not locked, but you still can't delete it, it's possible the file permission setting may be preventing you from deleting it.
  2. How.com.vn English: Step 2 Navigate to the file you want to delete.
    Use the Finder to navigate to the file you want to delete.
  3. How.com.vn English: Step 3 Hold ⌘ Command and click the file you want to delete.
    This displays a context menu next to the file you want to delete.
    • Alternatively, you can right-click the file, if your mouse or trackpad has a right button.
    • If you want to select multiple files, hold Shift and click all the files you want to select.
  4. How.com.vn English: Step 4 Click Get Info.
    It's in the context menu that appears when your Command-click (or right-click) a file or folder.[5]
    • If you have multiple files selected, hold Option and click Show Inspector instead.
  5. Step 5 Scroll down to "Sharing and Permissions."
    It's at the bottom of the "Get Info" or "Show Inspector" window. This shows permissions for all users on your Mac.[6]
    • If you don't see a list of different user permissions below "Sharing and Permissions," click the arrow icon () next to "Sharing and Permissions" at the bottom.
  6. How.com.vn English: Step 6 Click the lock icon (if locked).
    It's in the lower-right corner. If you are not signed in under an administrative account, you will need to enter the administrator's username and password in order to change permissions for a file.
  7. How.com.vn English: Step 7 Enter the administrative username and password and press ↵ Enter.
    This unlocks the "Sharing and Permissions" menu and allows you to change the permissions for the file.
  8. Step 8 Click the status next to your username below "Privilege."
    If you are unable to delete a file, your privilege is most likely set to "Read only." Click Read only below "Privilege" next to your username.[7]
  9. How.com.vn English: Step 9 Select Read & Write.
    This changes the file's permissions status from "Read only" to "Read & Write" which allows you to modify and delete the file.[8]
  10. How.com.vn English: Step 10 Drag the file to the Trash.
    It's the white icon that resembles a trashcan at the bottom of the screen in the Dock. Drag and drop the file into the Trash to delete the file. Now that you have changed the file permission to "read & write," you should be able to delete it without any problems.
  11. How.com.vn English: Step 11 Empty the Trash.
    To empty the Trash, right-click (or Command-click) the Trash icon in the Dock and click Empty Trash. This permanently deletes all files in the Trash.[9]
  12. Advertisement
Method 3
Method 3 of 5:

Unlocking a File from Within an App

Download Article
  1. How.com.vn English: Step 1 Open the app the file is associated with.
    Most Apple applications (including some non-Apple applications that use the Mac convention) allow you to lock a file using the title bar. Open the app the file is associated with.
    • For example, if the file is a Pages document, open Pages. If it is an image file, you would open Preview.
  2. How.com.vn English: Step 2 Open the file.
    To open the file, click File in the menu bar and then click Open. Navigate to the file and click it to select it. Then click Open.
    • Alternatively, you can just double-click the file to open the file and the app.
  3. How.com.vn English: Step 3 Click the filename.
    It's in the title bar at the top of the screen. This displays a drop-down menu.
  4. Step 4 Uncheck the checkbox next to "Locked."
    It's in the lower-right corner of the window that appears when you click the file name in the title bar. This unlocks the file.[10]
  5. How.com.vn English: Step 5 Drag the file to the Trash.
    It's the white icon that resembles a trashcan at the bottom of the screen in the Dock. Drag and drop the file into the Trash to delete the file.
  6. How.com.vn English: Step 6 Empty the Trash.
    To empty the Trash, right-click (or Command-click) the Trash icon in the Dock and click Empty Trash. This permanently deletes all files in the Trash.
  7. Advertisement
Method 4
Method 4 of 5:

Unlocking and Deleting a File with the Terminal

Download Article
  1. How.com.vn English: Step 1 Open the Terminal icon.
    The Terminal allows you to execute commands to the operating system with code. The Terminal has an icon that resembles a black screen with a white cursor. Use the following steps to open the Terminal:[11]
    • Click the magnifying glass icon in the upper-right corn of the desktop to display the Spotlight search bar.
    • Type Terminal in the search bar and press Enter.
    • Click the Terminal icon.
  2. How.com.vn English: Step 2 Type sudo chflags nouchg.
    This is the command to change the lock status of a file in the Terminal.
  3. How.com.vn English: Step 3 Enter the path and the file name after the command and press ↵ Enter.
    For example, if the file is a Word document, the command would look something like 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.
    • Alternatively, you can type the command SetFile -a l [path to file] and press Enter to unlock a file.
    • You may be asked to enter the Administrator's password in order to continue. If asked to do so, enter the password the Administrator uses to log in to their Mac user profile.
  4. How.com.vn English: Step 4 Enter sudo rm -r [path to the file] and press ↵ Enter.
    If all else fails, this Terminal command can force-delete a file.
  5. Advertisement
Method 5
Method 5 of 5:

Using Secure Empty Trash (macOS x 10.10 and Below Only)

Download Article
  1. How.com.vn English: Step 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. Therefore, this method is being phased out by Apple.
    • The Secure Empty Trash option has been removed in OSX 10.11 (El Capitan) and higher.[12]
  2. How.com.vn English: Step 2 Open the Finder icon.
    It has an icon that resembles a blue and white smiley face. Click the Finder icon in the Dock at the bottom of the screen to open the Finder.
  3. How.com.vn English: Step 3 Navigate to the file you want to delete.
    Use the Finder to navigate to the file you want to delete.
  4. How.com.vn English: Step 4 Drag the locked file into the Trash.
    The Trash is the white icon that resembles a trashcan at the bottom of the screen.
  5. How.com.vn English: Step 5 Empty the Trash securely.
    To do so, hold Command and click the Trash. Then click Secure Empty Trash.Alternatively, you can use the following steps to empty the Trash securely.[13]
    • Open the trash in the Finder
    • Click File
    • Click Secure Empty Trash.
  6. Advertisement

Expert Q&A

Search
Add New Question
  • Question
    How do you delete an application that won't delete on a Mac?
    How.com.vn English: Gonzalo Martinez
    Gonzalo Martinez
    Computer & Phone Repair Specialist
    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.com.vn English: Gonzalo Martinez
    Computer & Phone Repair Specialist
    Expert Answer
    If the above methods don't work, try using the application App Cleaner to delete locked files. Just drag the application onto App Cleaner and the application and all of its data will be deleted
  • Question
    Now that secure empty has gone, what reasonable way is there to delete large numbers of locked files, even if they are in the same folder?
    How.com.vn English: Community Answer
    Community Answer
    Right click (or 2 finger click) on the folder, then click "Get Info". Unlock the files through the "Get Info" section.
  • Question
    I don't use an admin password. Terminal command therefore won't give permission. Advice?
    How.com.vn English: Fancyghost
    Fancyghost
    Community Answer
    You'll need an admin password to do this. You also need to start commands with "sudo" in order to run them as an admin.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      How.com.vn English: Gonzalo Martinez
      Co-authored by:
      Computer & Phone Repair Specialist
      This article was co-authored by Gonzalo Martinez and by How.com.vn staff writer, Travis Boylls. 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. This article has been viewed 331,664 times.
      How helpful is this?
      Co-authors: 14
      Updated: February 28, 2024
      Views: 331,664
      Categories: Mac
      Thanks to all authors for creating a page that has been read 331,664 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement