projectz

Tech, Gadgets, Photography, Social Media and Poor Spelling

Force-deleting stubborn or problematic files in Mac OS X

Mac OS X can experience difficulty deleting certain files due to the following (and other) reasons:

  1. The file is in use by an application or system process
  2. The file is locked
  3. The user does not have permission to delete the file
  4. The file is damaged or otherwise corrupt and “cannot be found” by the system

Source: http://reviews.cnet.com/8301-13727_7-10328342-263.html

A. (File in use) If you receive an error message indicating the the file is in use by an application, try one of the following:

  • Quit any and all applications you think might be using the file
  • Open Activity Monitor (located in /Applications/Utilities) and kill any processes you think might be using the file (for more on killing processes with Activity Monitor, seethis article)

You can also restart, which may put an end to lingering processes that are unnecessarily making use of files you are attempting to delete.

B., C., D. (file is locked, user does not have permission, file is damaged) Select the file in the Finder and press the Command and I keys simultaneously (or select “Get Info” from the File menu). Try to deselect the box next to “Locked.” If the box is grayed out and you cannot change the locked status, you do not have permission to modify the file. In this case, try one of the following:

Use Secure Empty Trash The simplest workaround and the first one you should try is to drag the problematic file to the Trash, then (while in the Finder) select “Secure Empty Trash” from the “File” menu.

Modify permissions

  1. Select the file in the Finder. Hold down the option key, then go to the “File” menu and select “Show Inspector” (this item replaces “Get Info” when the option key is held)
  2. Go to the “Ownership and Permissions” section, then click the “Details” disclosure arrow.
  3. Click the small lock icon next to the “owner” menu, and enter your administrator password.
  4. Change ownership to your administrator account.
  5. From the “You can:” menu, select “Read and write”
  6. You should now be able to uncheck the “Locked” box and delete the file

Change lock flag via Terminal You can also manually unlock files via the Terminal with the following command:

  • chflags nouchg nameoffile

After which you can attempt deletion from the Trash, or use the Terminal delete command listed below.

Delete via the Terminal Failing the above, use the following command in Terminal (located in ~/Applications/Utilities)

  • sudo rm -R

followed by the location of the file you are trying to delete, e.g.:

  • sudo rm -R "/Applications/Photoshop CS2/legal/Tieng Viet.html"

Use Force Delete Finally, there is a freeware application dubbed Force Delete that can sometimes delete persistently locked and otherwise stubborn files.

The aforementioned workarounds can also be useful in a situation where Mac OS X says that the file marked for deletion “cannot be found,” or generates a numbered error.

 

Advertisements

One comment on “Force-deleting stubborn or problematic files in Mac OS X

  1. Roger33
    June 21, 2012

    Well! said about problematic files recovery in Mac. I was once searching for the method to retrieve mac files from trash and found the much needed solution here:

    http://www.recovermacfiles.net/trash.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Information

This entry was posted on June 20, 2012 by in guides, guides, howto, OsX, Third Party Blog, tip and tagged , , , , , , , , , , .
%d bloggers like this: