Can't empty the Trash or move a file to the Trash on Mac OS X - Hawkdive

Thursday, September 24, 2015

Can't empty the Trash or move a file to the Trash on Mac OS X

You can not empty the Trash or move a file to the Trash in Mac OS X


can not empty the Trash or move a file to the Trash on Mac OS X
can not empty the Trash or move a file to the Trash on Mac OS X
Issue: In Mac OS X, each user account and each drive has its own separate, hidden Trash folder that is located in the user's home folder for users and at the root (top) level of the volume for each drive.

"You can not empty the Trash or move a file to the Trash."
“You do not have sufficient privileges” or “Error code -8003.”
"The operation could not be completed because the item is locked."
"The file can not be deleted because it is in use"
"Could not move items to trash as it has an abnormal permissions"
can not empty the Trash or move a file to the Trash on Mac OS X
can not empty the Trash or move a file to the Trash on Mac OS X


can not empty the Trash or move a file to the Trash on Mac OS X
can not empty the Trash or move a file to the Trash on Mac OS X


can not empty the Trash or move a file to the Trash on Mac OS X
can not empty the Trash or move a file to the Trash on Mac OS X

Solutions: In Mac OS X, each user account has a separate, hidden Trash folder that is located in the user's home folder.

The location of this Trash folder is /Users/user_name/.Trash or ~/.Trash, which is a hidden folder as it has a dot prefixed to its name.

If you have secondary hard drives or other writable volumes connected to your Mac, each contains an invisible Trash folder named .Trashes at the root (top) level of the volume, which in turn contains an invisible Trash folder for each user.

When you open Trash to view its contents, it appears that all of the objects you have trashed are in a single Trash folder. In reality, Trash is displaying a list that is the union of the contents of all of the individual Trash folders associated with your account, on all writable volumes.When a user throws away a file on a local non-startup volume, the name of the folder on that volume is "/.Trashes/UID", where UID is the user ID number of the user (which may be seen in NetInfo Manager).

If you want to see the trash folder or want to verify if the Trash Folder is present in your user account, you have to run this command to show hidden files. Execute this command (as a regular user) from within the Terminal.

$ defaults write com.apple.finder AppleShowAllFiles TRUE
$ killall Finder



can not empty the Trash or move a file to the Trash on Mac OS X
can not empty the Trash or move a file to the Trash on Mac OS X

Reason and Solution of unable to empty Trash.

There could be numerous reason of being unable to empty the trash.Some of the major reasons are mentioned below with the troubleshooting steps you need to follow in any such scenarios.

1. Restart and Force the Trash to empty using the Option key

This technique uses a hidden feature of Mac OS X to force the Trash to empty.In many (but not all) cases, troublesome files reside on an external volume or drive. Manually deleting Time Machine backups via Finder – which is a big no-no – commonly triggers these problems.Other times, files on the main boot drive are in use by running applications and cannot be removed or the files are shared on network and are being used.Restarting the computer and then emptying the Trash always fix such issues if it does not, then try to empty trash forcefully by following method.


  1. Press and hold the mouse button on the Trash icon in the Dock. The context menu for Trash will appear.
  2. Press and hold the Option key or the Shift-Option keyboard combination,
  3. Select Empty Trash from the context menu for Trash.
    can not empty the Trash or move a file to the Trash on Mac OS X
    can not empty the Trash or move a file to the Trash on Mac OS X
  4. Release the keys pressed and held in step 2.
  5. If the Shift-Option combination does not help empty the trash then open trash and select the item manually which is left, and then press Option+Command+Delete.
  6. You'll get a confirmation dialog box to complete the deletion.
can not empty the Trash in Mac OS X
can not empty the Trash or move a file to the Trash on Mac OS X

2. Terminal Tricks to Empty and recreate an account's Trash
  1. Open the Terminal application.
  2. Type: sudo rm -rf
  3. Open your Trash.
  4. Choose Select All from the Edit menu.
  5. Drag all of your Trash into the Terminal window. This causes the Terminal window to automatically fill in the name and location of each item in your Trash.
  6. Press Return to delete them all.
Alternatively, the following commands will be the quickest way to clear and rebuild the trash folders on your Mac.Open terminal from /Application/Utilities/ and type the following command.

  1. sudo rm -rf ~/.Trash/ 
  2. if it is another user account: sudo rm -rf /Users/user_name/.Trash
  3. sudo rm -rf /.Trashes/ 
  4. sudo rm -rf /Volumes/<volumename>/.Trashes/

Respectively, this permanently deletes all files in the current user's Trash, the startup volume Trash, and the Trash for other volumes (if any). These commands cannot delete locked files. You have to unlock them first.

5. Press Return.
6. Type your Admin password when prompted, then press Return.
7. Type y for yes in response to the subsequent prompts to delete each file in the trash and finally the affected .Trash folder itself. The prompts are finished when the Terminal prompt returns.
8. Logout and Login or just restarts the computer, you would get a fresh new .Trash folder created for yourself.

Warning:Make sure the syntax to empty the trash is correct, the “sudo rm -rf” command will erase anything without warning. If you don’t know what you’re doing you could easily delete crucial system or personal files. Have backups ready or don’t bother with this method, proceed at your own risk.

3. The file is Locked, Unlock and then delete it.

Sometimes the file can not be deleted or moved to trash because it is locked.Select the file you are trying to move to trash or delete, then choose Get Info from the File menu. If the Locked box is checked, deselect it, then try moving/deleting the file again.
If the item you are trying to unlock is a folder,use these steps:
  1. Open Terminal (/Applications/Utilities).
  2. Type this, followed by a space: sudo chflags -R nouchg
  3. Drag the folder you would like to unlock into the Terminal window.
  4. Press Return.
  5. Enter your password and press Return.
  6. Now delete this file or empty the Trash.
OR Launch Terminal found in /Applications/Utilities/ and then type following two commands.
cd ~/.Trash
chflags -R nouchg *
and then delete all the items in Trash.

Note: If the checkbox immediately returns to the selected (checked) state, then this indicates that the file's system immutable flag has been enabled. This means that you cannot unlock the file until its system immutable flag is disabled.To solve this issue refer to the following link.
https://support.apple.com/en-in/TS1402

Locked files can easily be deleted if you press Shift-Option or Option key combination while emptying the Trash.Some users have also reported Command+Shift+Option+Delete to work as a method of forcing the Trash to empty regardless of a file being locked or owned by another user.
If these key combination does not work use the method mentioned in step 3. If a file still can not be unlocked, you may not have permission to unlock it or you may need to use Disk Utility's Repair Permissions feature.


4. Repair disk & repair disk permissions

Sometimes files become corrupt and need some attention before they can be deleted or moved to trash. Open Disk Utility from /Applicatios/Utilities/ folder. Click on your hard drive in the list to the left, then click the First Aid tab, and finally the “Repair Disk” button. If any errors are listed when it’s done, click “Repair Disk” again to make sure the error doesn’t come up a second time.
can not empty the Trash or move a file to the Trash on Mac OS X
can not empty the Trash or move a file to the Trash on Mac OS X
Next, click the “Repair Disk Permissions” button and let it scan the drive. This only needs to be done once. Repeat the “Repair Disk” and “Repair Disk Permissions” process for any external volumes or drives listed in Disk Utility as well. When finished, restart your Mac and try to force empty the Trash as described above.

5. You do not have permission on /.Trash Folder grant yourself Full permission to empty the Trash.

To be able to clear or empty trash make sure you have full permission on trash, if not grant yourself full permission using the following command.

1. Open Terminal
2. Type chmod 700 ~/.Trash

700 means you are granting the owner of the ~/.Trash directory read, write, and execute permissions to ~/.Trash.  This directory is located in the user's home directory, so by default the group and world need no access, hence the 0's.  For reference, if it has write only permissions, that would be 200.

Abbreviating permissions as numerals

You might have seen the permission on a file written as "-rwxrwxr-x" when executing the command ls. This is the Unix based abbreviation to permissions on a file or folder which is a little complex and not too user friendly.That's why there's a simple way to abbreviate permissions as numerals, ranging from 777 (-rwxrwxrwx) down to 000 (no access). An "rwx" becomes a 7, the sum of 1, 2, and 4, where 4=Read, 2=Write, and 1=Execute. A zero means no access. Each of the three numerals is the sum of permissions for Owner, Group, and Other, respectively. Thus our example of "-rwxrwxr-x" becomes 775.

6. file or volume name have special characters

Usually, Mac OS X can delete files whose names contain special characters, but sometimes you might need to follow this advice.

Note the name of the volume which the files are being deleted from. If you are not sure of the item's location, you can verify that by selecting it then choosing Show Info from the File menu. If the name of the volume contains any special ASCII characters, such as a bullet or trademark character, temporarily rename the volume so that it does not contain these characters.

Example: If you cannot delete files from a volume named "·Dox", rename the volume to "Dox". After the Trash is empty, restore the volume's original name as desired.

Examine the name of the files or folders you cannot delete. They should not contain a solidus ("slash", "/") character or any other special ASCII character such as a trademark, quotation mark, or copyright symbol. If the file does, remove the special character or slash from its name, then delete it.

Example: If you cannot delete a file named "Things/stuff", rename the file to just "t", then delete it.

7. Files is in use by other applications

If when moving the file to trash or while emptying trash you receive a message indicating that a file can neither be moved to the Trash, nor emptied from the Trash, because it is "in use" by another application.Quit the application that is using the file. This may let you move the file to the Trash or to empty the Trash.

If you are unsure of the application that is using the file " the Terminal command lsof can help you find the name of the process or application that Mac OS X considers to be using the file, as follows:
  1. Open Terminal, located in the Macintosh HD > Applications > Utilities folder.
  2. At the Terminal prompt type lsof followed by a single space, but do not press Return yet.
  3. Drag and drop the file "in use" from the Trash.The path to the file will appear after the lsof command,i.e. you will see lsof /path_to_file
  4. Press Return.
  5. Force the Trash to empty using the Option key.
  6. Log out, log in, and then attempt to empty the Trash.
  7. Restart your Mac, log in, and then attempt to empty the Trash.
If the file is "in use" then the output from lsof will list the names of the applications or processes which claim to be using the file under the first column heading, COMMAND.

If the file is "in use" by an open application, Quit (Command-Q) that application. If a background process has the file "in use," use Activity Monitor to terminate that process.

Note: One must be careful when terminating processes as certain background processes are needed for Mac OS X. Quitting processes like loginwindow or kernel_task could force you off your account, freeze your Mac, or cause a kernel panic. If you do not know what effect quitting a process may have, do not quit the process.

8. Kill the Process named "Locum".

Locum, is a latin word which is similar to lieutenant which means a person who temporarily fulfills the duties of another/superior, when his superior is absent.In Mac, locum is a process that assists finder doing things Finder cannot do, most likely because of privileges.So it is also used to assist in Deleting files and folders that the logged in user would not normally have access to.Locum is a Private Framework that Apple has created, and is currently located at:
/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/Resources/Locum.When it runs to execute few specific task , it consumes so much memory and resources.If during deletion of some files it stucks, you will not be able to delete any further.So killing Locum is the only solution.Follow the steps below to do this.

  1. Open the Activity Monitor from Utilities folder. 
  2. Select the Locum process in the window and then click the Quit Process button. 
  3. Enter your admin password when prompted. 
  4. Go back to the Finder and try to empty the Trash.It will now work.

Note: Very Important Tips- "Could not move items to trash as it has an abnormal permissions- Home folder might be locked."


Could not move items to trash as it has an abnormal permissions

In my case I tried all these steps and still could not delete any files from finder and can not move it to Trash.Every time I Try to delete or move any files it says "Could not move items to trash as it has an abnormal permissions.If the home folder is locked you can not even install any software or make changes to any existing softwares.

The reason I was getting this message because my Home Folder was Locked.So after unlocking the home folder it started working fine.


can not empty the Trash or move a file to the Trash on Mac OS X
can not empty the Trash or move a file to the Trash on Mac OS X


To Unlock the home folder

1. Click on the Go Menu in finder and select Go To Folder...
2. Type ~/
3. Right Click and select Get Info and check if the Lock Check box is checked.
4. If checked , Uncheck it and close the window.
5. Logout and Login again and then you should be able to delete or move files to Trash.


=====================

Incoming Search traffic
mac os x trash locked,can not empty the Trash or move a file to the Trash on Mac OS X,Could not move items to trash as it has an abnormal permissions,trash is locked,home folder is locked,You can not empty the Trash or move a file to the Trash,You do not have sufficient privileges” or “Error code -8003,The operation could not be completed because the item is locked,trash on mac does not empty,can not install any software


can not install flash player,can not update or install software update,can not delete or remove any software or files,can not clear the trash


No comments:

Post a Comment