How to delete file on desktop that cannot be deleted on mac?

Everyone has experienced undeletable files on the Mac desktop at some point. You try to delete a file or folder, but it stubbornly refuses to budge. The file may remain stuck even after emptying the Trash and restarting your Mac. This frustrating situation usually occurs due to file permission issues or system errors. Thankfully, there are various troubleshooting methods you can try to finally get rid of those pesky undeletable files.

Check File Permissions

Files can sometimes become locked or restricted due to permission issues, preventing you from deleting them normally. On a Mac, every file and folder has assigned permissions that determine which users can access, modify, or delete them.

To check a file’s permissions, right-click on the file and select “Get Info.” In the info window, click on the “Sharing & Permissions” section. Here you can see which users have Read & Write or Read only permissions. If your user account does not have Read & Write permissions, you may not be able to delete the file.

To change file permissions, click the lock icon in the bottom right and enter your admin password. You can then modify the permissions to grant your user Read & Write access. Be careful not to make the permissions too open or liberal. Refer to Apple’s guide on changing file permissions for more details.

You can also repair disk permissions using Disk Utility to reset files to their proper permissions. Open Disk Utility, select your startup disk on the left, click “First Aid,” and then click “Repair Disk Permissions.” This will reset system files to their default permissions.

Try Deleting in Safe Mode

Safe mode loads only the bare minimum drivers and software on your Mac, which can help delete files that won’t delete normally. To boot into safe mode on Mac:

  1. Restart your Mac and immediately press and hold the Shift key after you hear the startup sound.
  2. Release the Shift key when you see the login window (Safe Boot will appear in the top-right corner).
  3. Log in and try deleting the stuck file again.

With minimal software running, you may find the file now deletes successfully. Safe mode disables certain features which can interfere with deleting files normally, like system extensions or login items. This stripped down Mac OS environment sidelines any problematic apps or services that may be blocking the file deletion.

To exit safe mode, simply restart your Mac as normal.

Clear Trash

An important step to try when attempting to delete a stubborn file or folder on your Mac is to first ensure the Trash has been cleared. When you delete items on a Mac they are moved to the Trash folder, not immediately erased from the drive. The Trash must then be emptied to fully remove the files. Sometimes if the Trash is full, new files you try to delete may not go through until you clear out space by emptying the Trash.

You can empty the Trash in a few ways:

  • Click the Empty button in the upper-right corner of the Finder window when viewing Trash.
  • Right-click on the Trash icon in the Dock and select Empty Trash.
  • In the Finder menu bar, go to Finder > Empty Trash.

After emptying the Trash, try deleting the stuck file again. If it still won’t delete, the Trash may need to be cleared before you can remove the file. Refer to Apple’s Mac support guide for more details on emptying the Trash.

Disable System Integrity Protection

System Integrity Protection (SIP) is a security feature in macOS that prevents even administrators from modifying protected system files and folders. Disabling SIP provides full admin access to delete protected system files. According to Kadalin, you can disable SIP by:

  • Restarting your Mac into Recovery Mode
  • Opening the Terminal app in Recovery Mode
  • Running the command csrutil disable to turn off SIP
  • Restarting your Mac again

With SIP disabled, you’ll be able to delete any system file, including undeletable files on the desktop. Just be sure to re-enable SIP when you’re done by running csrutil enable in Recovery Mode. Disabling this protection permanently can make your Mac vulnerable.

Use Terminal

Terminal gives you access to powerful command line tools that can force delete stubborn files and folders. To delete a file using Terminal:

  1. Open Terminal (located in Applications > Utilities)
  2. Type “sudo rm -rf ” (without quotes)
  3. Drag and drop the file or folder you want to delete into the Terminal window after the command
  4. Press Enter to execute

This will force delete the target file or folder, overriding any permissions issues. Be very careful when using “sudo rm -rf” as it will delete files permanently without sending them to the trash. See this guide for more details: How to Delete a File in Terminal on Your Mac.

Try Third-Party Tools

Apps like DeleteFile and AppCleaner help delete stuck files. DeleteFile (source) is designed to delete any file, folder or app on your Mac that refuses to be removed through normal means. It scans your system and lists all stubborn items. You simply select the items you want deleted and click “Delete” to erase them.

AppCleaner (source) is another useful utility for getting rid of apps that won’t uninstall properly. It scans for all the associated files and dependencies of an app, allowing you to delete all traces. This prevents leftover app data from taking up space.

Tools like these provide a simple interface to force delete stubborn files and apps on a Mac. They can target the hidden files and dependencies that often cause uninstall issues. Before using them, be sure to back up your data in case you accidentally delete something important.

Reboot and Retry

Sometimes a file becomes locked because it is currently being used by an application or process. Rebooting your Mac essentially clears out any processes that could be locking the file and preventing you from deleting it. When your Mac starts back up, try deleting the file again before launching any other applications.

To reboot your Mac:

  1. Click the Apple menu in the top left corner of your screen.
  2. Select “Restart…”
  3. A dialog will appear asking you to confirm, click “Restart.”
  4. Let your Mac fully restart, then try deleting the file again.

Rebooting flushes out any processes that could be locking the file and gives you a clean slate to retry deleting it [1]. If the file still won’t delete after a reboot, you may need to try some of the other solutions like using Terminal commands or third party unlocking tools.

Recover Deleted Space

If you have tried every method to delete the stuck file but it still will not budge, the last resort is to reformat the entire drive. This will completely erase all data and files on the drive and allow you to start fresh. According to Apple support, you can use the Disk Utility app to erase and reformat a storage device on Mac [1].

To reformat the drive:

  1. Open Disk Utility
  2. Select the external drive from the left side panel
  3. Click “Erase” at the top
  4. Choose a format like APFS or Mac OS Extended
  5. Enter a name for the drive
  6. Click “Erase”

This will completely wipe the drive and delete all files, including the stuck file. Just be aware you will lose all data, so be sure to back up anything you need from the drive first. Reformatting provides a clean slate if you just cannot delete a file by any other means.

When to Seek Professional Help

In some cases, you may need to seek professional help to delete a file that cannot be removed. This is especially true for critical system files or files that will not move out of a key location like the desktop or documents folder. Attempting advanced procedures like disabling SIP could render your system unstable if not done properly.

For critical or unmovable files, it’s best to consult an Apple technician or a data recovery service. Professionals have specialized tools and knowledge to safely access protected system files. They can also recover deleted data if needed [1]. This type of expert help does come at a cost, so weigh the value of the undeleteable file vs. the expense of professional assistance.

In general, if you’ve exhausted all the standard troubleshooting methods to delete a file and it still stubbornly remains, it’s smart to hand it off to a professional rather than risk making the situation worse. Data recovery specialists have seen it all when it comes to deleting stubborn files and can almost always find a safe solution.