Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

can I selectively empty trash on usb stick without emptying desktop trash?

So I know this question has been asked on the forums before: can i selectively empty the trash on my usb stick without emptying the trash on my desktop. The answer back in 2008 was no! OSX didn't allow that sort of selective trashing. Various risky (ie rm in terminal) or timeconsuming (temp folders) workarounds were offered. Does anyone know if mountain lion has solved this problem?


By way of explanation: I work with hundreds of thousands of image files every day, and need to create space on usb drives daily. But I also don't want to lose my desktop trash everyday - sometimes its a lifesaver and my desktop harddrive has plenty of space to spare for my unwanted files. Using a temp file doesn't work for my 'flow' so I'm just hoping that mountain lion has some hidden feature that I can use to selectively empty my usb drives.

iMac, OS X Mountain Lion (10.8.4)

Posted on Oct 16, 2013 11:25 PM

Reply
35 replies

Oct 17, 2013 1:09 PM in response to muswellbrook@icloud

That is, pretty much, one of the sillier attempts at creating a problem that I have seen. Who in their right mind would store required files in Trash? Emptying external drive and USB flash device trash are another function of the Trash. Why creat a hurdle to put in it's way. The simple answer is to change your work habits and follow Old Toad's suggestion.


Good Luck


Pete

Oct 17, 2013 1:45 PM in response to Old Toad

I appreciate the suggestion, and I've thought about using a pre-trash folder. I'm sure I'm not the only person here who has trashed a file thinking I was finished with it, and then had to retrieve it again days (or even weeks) later when circumstances change or some unexpected need arises. Obviously the point of having a trash folder is to provide a certain level of redundancy in the system to allow for unexpected circumstances. If the trash is emptied as soon as anything is placed in it (as some people do), this useful redundancy is lost and you may as well just have a delete key. A pre-trash folder simply adds one more level of redundancy (one level too far for my tastes, but whatever). Anyway, my point is merely that making space available on a small usb drive should not interfere with the desktop trash which serves a useful purpose in data management.


Claims by others on this forum that no one in their right mind would delete files they may later need are less than useless additions to this discussion. No one deletes files they think they will need.

Oct 17, 2013 2:46 PM in response to muswellbrook@icloud

muswellbrook@icloud wrote:



Claims by others on this forum that no one in their right mind would delete files they may later need are less than useless additions to this discussion. No one deletes files they think they will need.

I don't see where what you say was claimed. I do see a suggestion that no one in their right mind would STORE required files in Trash. And as you don't wish to use Terminal and other 'risky'


Various risky (ie rm in terminal) or timeconsuming (temp folders) workarounds were offered. Does anyone know if mountain lion has solved this problem?


(there was no problem until you created it) ), then you need to change your work practices. Pretty simple. What you are currently doing is the riskiest thing of all!!😉




Good luck


Pete

Oct 22, 2013 4:29 AM in response to muswellbrook@icloud

Then you would have to know the USB name to use in the path for each stick.

I have no idea if there is a way (besides writing a script that found all of your named sticks) to identify a USB stick independently from everything else mounted on /Volumes, but if you had more than one inserted, which one would you want to empty the trash for?

Dec 22, 2013 1:08 AM in response to muswellbrook@icloud

Hey muswell...


Very easy thing to do. You HAVE to be mildly tech proficient but if you feel comfortable in terminal then it should be easy.


1) show hidden folders (search for showing hidden folders in OSX)


2) open terminal and type in " rm -rf " * rm is remove command, r removes folders, f removes files ** important to have a SPACE after the f (otherwise the command doesn't work)


3) open your USB stick, now (with show hidden folders alllowed) you can see the .trash folder in grey. Open the folder. select any or all files you want to delete. !! select only files to delete, not the .trash folder itself or other technical files !!


4) drag and drop files to terminal window. They will automatically populate. Hit return and delete!



I love this option because my USB sticks/externals started to lose free space even though there was no files on it. Turns out that when files are trashed from USB sticks, OSX simply moves them into a .trash folder on the USB and hides it. So the USB looks empty but all the files are still there. Only way to remove files is to a) lame-mac-OSX-one-size-fits-all solution of emptying all the trash everywhere or b) this tech method to smoothly delete only the files you want.


and yes, first answer guy (yeah you barney) is very very lame and arrogant.


- listen and understand the question first. Then you can give an answer.

Dec 28, 2013 9:45 AM in response to muswellbrook@icloud

@Luke Miller is correct, and the OP question was well stated and reasonable.


Terminal was the only way I found to empty the Trash folder on my USB memory stick, at least with OS-X 10.7.5 on my old iMac. I have not tried on my newer machines at the moment, but I have no reason to believe this has changed.


Empty Trash on OS-X does not empty the trash folder on my USB memory stick, which led me to this thread.


The solution using Terminal.app, with a few extra bash commands to help you get started navigating:

cd \

ls -al

cd Volumes

ls -al

cd <put the name of your memory stick drive here>

ls -al

cd .Trashes

ls -al

cd 501 <That was the name of the only folder in .Trashes on my drive>

ls -al

rm <name of file you wish to delete.


If this is your first time using Teminal.app, it opens a command line interface with a bash ("Bourne-again shell") session. The command "cd" is change directory, "ls" is list (with switches -al giving more information on the list), "rm" is remove. You can learn more by searching "unix commands". Be careful, rm can remove system files. You may need to run Terminal.app when logged in with Admin privileges.


Other posters here (petermac87, Barney, Old Toad) did not understand the OP's question and need to be more careful in posting. Leaving files in ".Trash" on a memory stick, as OS-X does, can be a security problem, and Empty Trash does not work on all memory sticks.

can I selectively empty trash on usb stick without emptying desktop trash?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.