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

Emptying trash for only certain files?

1. Is there a way to empty only certain files from the trash without emptying all of the files?

2. When a USB jump drive is plugged in, is there a way to empty the trash for just those files and not for the Mac?

Thanks.

Macpro, Mac OS X (10.5.1)

Posted on Mar 22, 2011 10:25 AM

Reply
Question marked as Best reply

Posted on Mar 22, 2011 10:27 AM

Is there a way to empty only certain files from the trash without emptying all of the files?


Not without using the UNIX command line or third-party software. If you think you might want to keep something, the only copy of it shouldn't be in the trash.

When a USB jump drive is plugged in, is there a way to empty the trash for just those files and not for the Mac?


See above.

(57371)
40 replies

Jun 18, 2012 3:30 AM in response to Mark P1

1. Open terminal app

2. Type "rm -r " without the quotes. (NOTE there is a single space at the end of this command, dont forget it)

3. Now open trash and drag the file/folder you want to delete and drop it on the open terminal (this will append the full path of the file/folder you want deleted to the above command, making it "rm -r /Volumes/blah/blah")

4. Press Enter key in terminal

Apr 12, 2013 1:19 AM in response to VailComputerGuy

Hi guys,


I know this thread is quite old now, but I just stumbled upon it looking for something else (happens all the time, right?), and I have a small contribution to make:


You can create a sort of temp folder inside the Trash, that you'll call whatever you like, so long as it's explicit enough (something along the lines "Stuff I'm not yet sure I want to part with", maybe?), and lock it, either via Terminal, or simply by displaying info for this folder and check the "Lock" mark).


Then you create an alias for this folder, that you'll place either on your Desktop or, better yet, in your Dock, next to the Trash, for example. Any item you drag and drop on this alias will end up in the Trash sub-folder you've just created, and when you empty the Trash, this folder should remain untouched.


What's in this sub-folder you really want to "part with" would have to be either dragged and dropped directly in the Trash itself, or you can simply purge this sub-folder via Terminal with a simple "sudo rm -rf Trash/Name_Of_The_Subfolder/*" command.


What do you guys think? (If you even remember you posted in this thread...😁)

Apr 12, 2013 1:56 AM in response to FrenchToast

It would be more simple to ...


1. Create a folder, name it and lodge it in the trash.

2. Go through your trash periodically and transfer anything you are uncertain about losing to the folder.

3. To empty trash at any time, drag folder to your desktop, then empty trash.

4. Job done, drag folder back to the trash (to await any more uncertainties).

5. Now and then review the contents of the folder dragging anything unwanted back into the trash.

Jun 21, 2013 11:44 AM in response to Mark P1

The whole purpose of having a trash can or recyle bin is that you might delete something accidentally OR you might delete something today that you decide at a later time you need.


So it makes perfect sense to want to empty part of the trash.


For example, I want to empty it of any files deleted in 2012 or earlier to regain some disk space. (That's how I ended up here.)


At this point, I'm sure I don't need any files I deleted in 2012.


But I MIGHT have a need for something I deleted last week.


So I'm on the side of the folks who think this is a basic function that the trash should have.

Jun 21, 2013 12:38 PM in response to Glenn112

I am afraid that I must concur with Thomas A Reed on this one.


I think that the way that Apple has handled Trash all of these years is a valid way of doing Trash.


I think rather then modifying the way Trash works, what you should do is to modify your way of using to take Trash.


The fact that none of the backup software backs up any files in Trash makes it a really poor place to store anything at all.


If you wish to do something like you are suggesting, I think a better solution would be to create a folder called "Almost Trash". You can then put your files there instead of in Trash.


Allan

Jun 22, 2013 1:11 AM in response to Allan Eckert

There seems to be a consensus around the fact that the way OS X deals with deleted items is relatively straightforward in its implementation, but some users will always find a need that hasn't been envisioned by Apple engineers, and will then look for a way to fulfill this untimely need...


Not to boast, but I like my method better: the locked subfolder you place in the Trash should be left untouched when you empty your Trash, therefore leaving the content you're not sure you want to delete unscathed.


After that, it's just a simple matter of writing a script to empty this folder if/when you decide to, while removing from your most-oft used folders all the files and folders you seldom/never have use for anymore.


I know I don't like to open a folder in the Finder to find it cluttered with files I have no use for. The subfolder I mention could serve as a waystation to permanent digital oblivion.


You could even call it Purgatory! 😁

Aug 12, 2013 5:29 PM in response to salper7

Open Automator.

Select Service as the new type of workflow.

For Receives input, select Files and Folders in Finder

Drag in an Ask for Confirmation action. Set it up with the question you want. (optional, but safer).

In Utilities library, drag in a Run Shell Script action.

Set it to pass input as Arguments.

Replace the shell script action with

rm -R "$@"

Save the workflow with a short name like, "Delete Now"

When you right-click on files or folders in Finder, it will be available in the Services submenu.


Note that you will be able to easily erase much more than the things in your Trash, and there is no getting them back.

Emptying trash for only certain files?

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