Professional Documents
Culture Documents
http://www.thexlab.com/faqs/trash.html#Anchor-Force-11481
About
X-Books
X-FAQs
X-Services
X-Links
Support
1 of 7
9/24/08 1:35 PM
http://www.thexlab.com/faqs/trash.html#Anchor-Force-11481
2 of 7
9/24/08 1:35 PM
http://www.thexlab.com/faqs/trash.html#Anchor-Force-11481
This technique uses a hidden feature of Mac OS X to force the Trash to empty. Perform the following steps in the order specied: 1. Press and hold the mouse button on the Trash icon in the Dock. The context menu for Trash will display. 2. Press and hold the Option key. 3. Select Empty Trash from the context menu for Trash. 4. Release the Option key. Force the Trash to empty using Terminal This technique uses a Terminal command to fore the Trash to empty. Perform the following steps in the order specied: 1. Launch Terminal, located in the Macintosh HD > Applications > Utilities folder. 2. At the Terminal prompt, type the following command exactly as written:
sudo rm -rf ~/.Trash/*
Note that: There is a single space after each of the terms sudo, rm, and -rf in the command. Assure you have typed the command exactly as written before proceeding: typographical errors in this command can have dire consequences, including erasing your hard drive! 3. Press Return. 4. Type your Admin password when prompted, then press Return. The les in the Trash are now deleted. Empty and recreate your account's Trash The following procedure will "kill two birds with one stone." It will both: 1. Empty your Trash. 2. Create a new ~/.Trash directory for you with correct ownership and permissions. Perform the following steps in the order specied: 1. Launch Terminal, located in the Macintosh HD > Applications > Utilities folder. 2. At the Terminal prompt, type the following command exactly as written:
sudo rm -rf ~/.Trash
Note that: There is a single space after each of the terms sudo, rm, and -rf in the command. Assure you have typed the command exactly as written before proceeding: typographical errors in this command can have dire consequences, including erasing your hard drive!
3 of 7
9/24/08 1:35 PM
http://www.thexlab.com/faqs/trash.html#Anchor-Force-11481
3. Press Return. 4. Type your Admin password when prompted, then press Return. 5. Log out of your account or restart your Mac. 6. Log in to your account. You will now have a new, working, and empty Trash. Steps 1-4 remove all les in your Trash as well as deleting the hidden and invisible ~/.Trash directory for your account. Steps 5 and 6 result in your Trash being recreated with proper ownership.
4 of 7
9/24/08 1:35 PM
http://www.thexlab.com/faqs/trash.html#Anchor-Force-11481
3. 4. 5. 6. 7.
4. At the Terminal prompt type lsof followed by a single space, but do not press Return yet. 5. Drag and drop the le "in use" from the Trash the Finder window opened in step 1 to the Terminal window opened in step 2. The path to the le will appear after the lsof command typed in step 3, i.e. you will see 1. lsof /path_to_file 6. Press Return. 7. If the le is "in use" then the output from lsof will list the names of the applications or processes which claim to be using the le under the rst column heading, COMMAND. 8. If the le is "in use" by an open application, Quit (Command-Q) that application. If a background process has the le "in use," you can use Activity Monitor (Tiger, Panther) or Process Viewer (Jaguar) to Quit that process. 9. Note: One must be careful when quitting 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. Force the Trash to empty using the Option key. Force the Trash to empty using Terminal. Use one of the recommended Trash utilities. Log out, log in, and then attempt to empty the Trash. Restart your Mac, log in, and then attempt to empty the Trash.
Insufcient privileges needed to trash an object Warning: If Mac OS X informs you that you have insufcient privileges to delete a le, this may be because you are attempting to delete a System-related le. You should not delete System-related les unless you are absolutely sure you know what you are doing. Deleting System-related les could render your system unusable. If you are informed that you have either insufcient privileges or insufcient permissions to trash a le or folder, you may be able to trash the object in question using the following procedure. 1. Make yourself the Owner of the le, with Access of Read & Write, using the instructions in the AppleCare Knowledge Base document from the following list corresponding to the version of Mac OS X you are using: "Mac OS X 10.4 Help: Setting permissions for disks, folders, and les." "Mac OS X 10.3 Help: Setting permissions for disks, folders, and les." "Mac OS X 10.2: How to Change Ownership & Permissions Using the Finder." 2. Trash the le. Incomplete Internet downloads under Jaguar Downloads which fail to complete can sometimes leave you with les which can neither be moved to the Trash nor emptied from the Trash. 1. If the downloaded le is in the Trash, try one or more of the following procedures to empty the Trash: Force the Trash to empty using the Option key. Force the Trash to empty using Terminal. Use one of the recommended Trash utilities. 2. If the downloaded le cannot be moved to the Trash, try the procedure in the AppleCare Knowledge Base document "Mac OS X 10.2: Cannot Delete an Incomplete Copy or Download." In particular, try the TextEdit tip.
5 of 7
9/24/08 1:35 PM
http://www.thexlab.com/faqs/trash.html#Anchor-Force-11481
Files dragged to the Trash "will be deleted immediately" alert If you are informed that les dragged to the Trash "will be deleted immediately," there are three possible causes: [1] 1. You are either no longer the Owner of your Home folder, do not have Access of Read & Write to such, or both. 2. Your account's Trash, i.e. your ~/.Trash directory, has been deleted. 3. You no longer are the owner of your account's Trash. To resolve this problem, proceed as follows: 1. Assure you are the Owner and have Access of Read & Write on your Home folder: 1. In Finder, press the Command-Shift-H keyboard combination. A Finder window opens showing the contents of your Home folder. 2. Press the Command+I keyboard combination. The Get Info window for your Home folder opens. 3. Select the Get Info window. 4. Select the disclosure triangle for the Ownership & Permissions panel in the Get Info window. 5. If using Mac OS X 10.3 or later, select the disclosure triangle for the Details panel within the Ownership & Permissions panel. 6. If you are not listed as Owner or Access is not Read & Write, then: 1. If the Lock icon next to the Owner pop-up menu appears locked, click it. It should then appear unlocked. 2. Select your account's short name in the Owner pop-up menu. 3. Select Read & Write in the Access pop-up menu immediately below Owner. 4. Type your Admin password if prompted to authenticate. 5. Click the Lock icon again. It should now appear locked. 6. Close the Get Info window. 7. See if you can now place objects in the Trash. If so, the problem is solved: stop here. Otherwise, proceed to the next step. 2. Verify that your ~/.Trash directory exists: 1. Launch Terminal, located in your Macintosh HD > Applications > Utilities folder. 2. At the Terminal prompt, type the following command exactly as written: 1. ls ~/.Trash 3. Press Return. 4. If the response contains "No such file or directory" then: 1. Either log out of your account or restart your Mac. 2. Log in to your account. You should now be able to add objects to the Trash: stop here. 5. Otherwise, proceed to the next step. 3. Empty and recreate your account's Trash. Immutable les There are rare issues which can inhibit emptying the Trash. These include immutable les and les on which the System Immutable ag has been set. If an object cannot be deleted using any of the preceding methods, you may have encountered this rare situation. Dealing with immutable les is covered in the tutorial "How to Fix Stubborn Trash Problems" on OSXFAQ.
Related links
All AppleCare Knowledge Base documents related to Trash and Tiger, Panther, or
6 of 7
9/24/08 1:35 PM
http://www.thexlab.com/faqs/trash.html#Anchor-Force-11481
Jaguar.
Notes
[1] When dragging les to the Trash from removable media, such as a Zip disk, it is common for Trash to inform you that the les will be deleted immediately. I suspect this was a design choice due to every writable volume having its own Trash folder. If you ejected the Zip disk before emptying the Trash, the les you thought were deleted would still be in the Zip disk's .Trashes folder at the root (top) level of its directory. Hence Mac OS X will immediately delete les moved to the Trash from removable media. This also depends upon the rmware of the device informing Mac OS X that it is a removable media device.
7 of 7
9/24/08 1:35 PM