Useful Tips

Can't delete a file on Mac? How to delete locked files in OS X


In any operating system, both desktop and mobile, working with files also implies the possibility of deleting them. Today we want to tell you about the deletion of certain files in the macOS operating system.

Method 1: Delete through the "Recycle Bin"

The "Basket" tool in macOS plays the same role as a similar solution in Windows: it is a dedicated zone in the storage space in which documents that are not needed by the user are archived. Files placed in this zone can be either permanently deleted or restored. The procedure consists of two stages: moving the file or files to the "Recycle Bin" and its subsequent cleaning.

Moving to the "Basket"

  1. Open the Finder and browse to the location of the document you want to delete. Highlight the desired data.

Next, use the menu bar, items "File""Move to Trash".

You can also use the context menu: right-click on the selected file (or touch the touchpad with two fingers at the same time), and select the appropriate item.

Advanced users can use the keyboard shortcut - for the desired operation, press Command + Backspace.

Finally, dragging and dropping the deleted file from the Finder window onto the icon will also work. "Baskets" in the dock panel.

  • The selected data array will be moved to the Recycle Bin.
  • Using the described method, you can move both individual files or several files at once. Also this sequence will work for directories.

    Empty the Recycle Bin
    To completely delete a file, you can either empty the Recycle Bin completely or delete a separate file or files from it.

      Use the dock area to open space "Baskets".

    A window will open, similar to the standard Finder, in which the space will be displayed "Baskets". Complete deletion of the contents of this space is available by a special button.

    Through this menu, you can also permanently delete a single document, folder or their array.

    When prompted for cleaning, a warning appears. At this stage, we recommend making sure that you really do not need the deleted files anymore, and only then confirm the start of the procedure.

  • After cleaning, the selected data or all contents "Baskets" will be permanently deleted.
  • We recommend that you use this deletion method first of all, since it makes it easy to recover data in the event of an erroneous deletion.

    Method 2: Direct Total Removal

    Direct deletion of documents and / or directories is available through the menu bar.

    1. Use the Finder to navigate to the file you want to delete and select it.
    2. Hold down the key Option, then open the menu bar item "File", and select an option Delete immediately.

  • A warning window will appear. To confirm the operation, select Delete.
  • You can simplify the permanent deletion of files using the appropriate key combination - in this case, it looks like Option + Cmd + Backspace (Delete).

    Done - the selected data will be completely deleted from the drive.

    Cannot delete file

    Sometimes the execution of even such an elementary procedure does not occur as expected - for example, the system reports that the file is locked and cannot be deleted. We will analyze the main reasons for this behavior and the steps to resolve the problem.

    • Perhaps the document you are trying to delete is a system document. Such files are best left alone,
    • Deletion of some data is available only for accounts with administrator privileges. Check your account - to do this, open System Preferences through the Apple menu

      Then use the item "Users and groups".

    Deleted files can be protected. Open the properties of the problem document using any convenient method (via "File" menu bar, context menu or keyboard shortcut Cmd + i) and pay attention to the item "Protection".

    If it is marked as active, simply disable it and try deleting the problem data again.

    Also, due to protected files, the procedure for deleting them from the recycle bin may not work. The procedure can be performed with the key held down. Option: hold it, then use the context menu item "Empty trash".

    Sometimes a full recycle bin is not required, but you need to delete locked files. Of course, you can remove protection from them and delete them one at a time, but there is a more elegant solution.

      Open "Terminal" - the easiest way to do this is through the folder Utilities, which can be opened through "Transition" Finder menu bar.

    Enter the command chflags -R nouchg into the terminal, but you don’t need to execute it yet: just put a space after the last word.

    Open the window "Baskets", select locked files in it and drag them to "Terminal". Next to the previously registered command, their names should appear.

  • Now enter the command by clicking on Returnthen calmly empty the basket.
  • How to delete locked files on Mac?

    1. Right-click on the file and select the menu "Properties".

    2. In section "Are common" uncheck the item "Protection".

    3. Close the window "Properties".

    In the opposite way, you can block files on the icon of which a lock image will appear.

    However, when the recycle bin is emptied, locked files can be deleted by affirmatively answering the question whether we really want to delete protected objects.

    Thus, the file locking function is purely precautionary in nature, which is also good, especially if this is a regular feature of the operating system.

    Delete an item from a Mac or from iCloud Drive

    On a Mac, drag an object to the Trash in the Dock, or select it and press Command-Delete. If the object is locked, click Continue to confirm the movement of the locked object to the Trash.

    If the object is locked, you need to confirm that you want to move it to the Trash, or previously unlock it. To unlock an object, select it, choose File> Properties (or press Command-I), and then clear the Locked check box. If you are not logged in as an administrator, you need to click the lock icon, then enter the administrator name and password.

    Empty Trash

    On a Mac, click the Recycle Bin icon in the Dock.

    In the window that appears, do one of the following:

    Delete one item from the Recycle Bin. While holding down the Control key, press the object you want to delete, and then select Delete Immediately.

    In the warning window that appears, click Delete.

    Delete all objects from the Recycle Bin. Click the “Clear” button in the upper right corner of the Finder window. You can also click the Finder icon in the Dock, then choose Finder> Empty Trash.

    In the warning window that appears, click "Empty Trash."

    Items moved to the Trash from a Mac are not deleted until you empty the Trash. In the Finder settings, you can choose to automatically empty the Trash.

    Items moved to the Trash from iCloud Drive are automatically deleted from the Trash after 30 days, regardless of the Finder settings. You can empty the trash in less than 30 days.

    A WARNING. Any objects deleted while emptying the Recycle Bin become inaccessible.

    How to get rid of the warning that appears when emptying the basket

    To get rid of the warning that appears when cleaning the Trash, do one of the following:

    Once: Hold the Option key when you click "Clear" or select "Empty Trash."

    Is always: You can disable the warning in the "Add-ons" panel in the Finder settings. In Finder, choose Finder> Preferences, click Add-ons, then uncheck the box next to “Warn me when I empty the Trash.”

    Complete removal

    For the file to be deleted bypass basket, click Command (⌘) + Option + Delete. A dialog box appears in which you will need to confirm the file will be permanently deleted.

    Please note that a file deleted this way can only be recovered through Time Machine.

    Empty trash without confirmation

    The previous method is good, but with this removal, the system displays an additional dialog box with the need to confirm. In addition, if the basket contains objects blocked by the system or other applications, deletion will be canceled.

    Remember the most radical shortcut: Command (⌘) + Shift + Option + Delete.

    After clicking it, the basket will be emptied without dialog boxes and with the removal of blocked objects.

    ⭐ Thank you re: Store for the helpful information.

    (No votes)