Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have a USB plugged in Mac. What I found was .Trashes was not emptied with the emptying trash (right click of the trash and run empty trash) for the USB drive.

What might be wrong? Is there any other way to empty trash the USB drive?

share|improve this question
6  
Interesting, emptying the trash always does so successfully for my USB drives. My only complaint about it is that often I'd like to only empty the trash on my USB drive and not have to do so for every drive on the system. –  Matthew Frederick Jan 16 '11 at 0:34
3  
@Matthew try rm -R /Volumes/volumename/.Trashes/$UID –  Gordon Davisson Jan 16 '11 at 2:55
    
@Gordon Perfect, thanks! Created a one-line Applescript to run the command and it's a couple of QuickSilver keystrokes any time. –  Matthew Frederick Jan 16 '11 at 8:22

4 Answers 4

up vote 11 down vote accepted

It's possible that the files are in some other user's trash. The .Trashes folder at the top of each volume has subfolders for each different user, by user ID number (e.g. user #501's trash is in .Trashes/501). You can delete everyone's trash by deleting the entire .Trashes folder with sudo rm -R /Volumes/volumaname/.Trashes (warning: as with anything involving "rm -R", use this carefully; if you type it wrong, it could have ... unpleasant consequences).

share|improve this answer
    
The "might be in someone else's Trash" is exactly the issue I was running into. This should be better advertised! –  cdeszaq Nov 11 '12 at 16:28
    
Adding the -f switch to the command will force the action. Substituting the "volumename" with "*" would allow you to connect multiple USB drives and empty all the Trash on all of them simultaneously. Don't have to connect 1-by-1 and then re-do. –  Danijel J Sep 28 '13 at 10:25

I don't know wether it's the best answer, but at least it's working answer.

Open the command line, go to the USB volume (/Volumes/USB for my case), and /bin/rm -rf ./Trashes/* works fine with me.

share|improve this answer
    
This would require the user has to go to the specific volume each time. Building on your reply, I've come up with a Bash script and AppleScript solution. –  Danijel J Sep 28 '13 at 10:09

Usual behavior:
When you delete something off a USB drive, it is moved to a .trashes folder on that volume. When plugged into your computer, deleted items will appear in your trash bin with everything else.
When you unplug it, items that you've deleted from that drive will no longer show up in your trash UNTIL you plug it in again. Then, you can empty the trash. It will really delete them from that drive.

If that isn't happening for you, here's my suggestion:
Select the drive in your Finder sidebar. Without selecting anything else, press cmd-i. Use the Sharing and Permissions section of that window to set Everyone to Read and Write.

Hope this helps.

share|improve this answer
    
This should be accepted –  zsitro Sep 9 at 14:43

2 Solutions. 1 using Bash the other using Bash wrapped in AppleScript.

Solution #1

  1. Create a new AppleScript with /Applications/Utilities/AppleScript Editor
  2. Type the following code:

    do shell script "rm -rf /Volumes/*/.Trashes/*" with administrator privileges

  3. Save the file to somewhere convenient and run it whenever you need to clear the USB Trash
  4. This can be executed by double-clicking on it

NOTE: This will empty the Trash for all connected volumes including your internal hard disk. If you have connected 5 USB drives and a Firewire hard disk, it will empty the trash for all of them.


Solution #2

  1. Fire up your favourite text editor (mine is nano)
  2. Paste the following code into your text editor and save the file

    #!/bin/bash
    sudo rm -rf /Volumes/*/.Trashes/*

  3. Save the file to somewhere convenient with the extension .sh and then make it executable with chmod +x {filename}.sh from Terminal

  4. Run that with ./{filename}.sh

NOTE: Same note as above. This is executable from Terminal.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.