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

Can you selectively delete items from Trash?

Is it possible to selectively delete a file from Trash without emptying everything?

iMac (24-inch Early 2009), Mac OS X (10.6.8)

Posted on Aug 6, 2012 9:59 PM

Reply
18 replies

Aug 6, 2012 10:27 PM in response to rollerboy_1979

Thanks Niel,


I added the Delete button to the Toolbar on the Trash Folder, and it removes the item, but it puts it back on my Desktop. Also, when I select certain files, the "Delete" button is grayed out (?). I guess I'll have to create a "Possible Trash Folder" and go that route.


Rollerboy_1979


Message was edited by: rollerboy_1979

May 22, 2013 3:39 PM in response to BDAqua

Sorry, that's not correct. It's easy to selectively delete folders using Unix commands at a terminal prompt.

Steps:

1.) Open a terminal (Applications > Utilities > Terminal).

2.) Navigate to the Trash:

at the command prompt, enter:

# cd ~/.Trash

3.) To list everything in the trash, enter:

# ls

(Note this may give you a huge list that you have to scroll in the terminal screen to see.)

4.) To delete a file, enter:

# rm <file_name>

(Note a few things here:

- BE CAREFUL - this is not undo-able if you delete the wrong thing.

- you don't have to type the whole name, you can use name completion

by typing the tab key if the name is unambiguous

- "rm" will only work in its naked form for files, you will get an error

if you try to delete a directory this way.)

5.) To delete a directory: double, triple, and quadruple check you are doing the right thing.

...And don't blame me if you screw up and delete your whole hard drive..

..and enter the dreaded:

# rm -rf <directory_name>


Happy deleting...

Mar 7, 2015 6:54 AM in response to rollerboy_1979

Create an automator service accepting files and folders from finder as input.

add ask for confirmation

then add run shell script

select Pass inputs: as arguments

type(rm -R "$@") without the brackets (including the quotes)

save the service as something like, "Permanently Delete"


For those who are not comfortable using the command line, there is rather an ingenious way....

First create a folder named "deleter" on desktop and in documents ( you can choose any 2 locations )

Again create an automator service accepting files and folders as input.

  • optionally add "ask for confirmation"
  • "Move finder Items" to the 'deleter' folder (which was on the desktop/location1)
  • add 'get specified finder items" (ignore input on this action by right-clicking and selecting 'ignore input') and add the 'deleter' folder which was created in documents folder/location2.
  • add "move finder items" to 'desktop/location1' and tick 'replace existing files'
  • Now add run shell script and again ignore input. type :

cd ~/Documents (or add the path to location2)

mkdir deleter

save it

The run shell script action was added so that this service can be used again and again... otherwise we would have had to create the the deleter folder in documents every time before using the service.


try it out...!

Can you selectively delete items from Trash?

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