Delete a file without moving it to trash

Sometimes I would like to delete a file (e.g. large file I am certain I don't need) directly, without moving it to trash. I have been using Compost in 10.5. Unfortunately Compost doesn't work in 10.6. Does anyone here know a similar software in 10.6? Thanks much.

Mac Pro 2.93 Quad-Core, 12GB RAM, 7TB HD, Mac OS X (10.5.8)

Posted on Nov 27, 2009 9:07 PM

Reply
12 replies

Nov 27, 2009 10:00 PM in response to Wanderzhuanyou

may I ask why you want to bypass thrash? moving to trash is very quick and provides safety net of not deleting something by accident. it's very easy to put a GUI wrapper on the unix rm command that baltwo mentioned so I'm sure there are plenty of such apps on macupdate .
http://search.macupdate.com/search.php?keywords=delete+&os=mac

you can also easily make a finder contextual menu plugin for this using automator without using any 3rd party software at all. ask if you want details.

Nov 27, 2009 10:25 PM in response to V.K.

I usually keep deleted files in trash and from time to time I need to search mistakenly deleted files in trash. So I would like to keep "meaningful" files in trash. Sometimes I need to delete a lot of "meaningless" files (e.g. for testing a device) and I don't want them sitting in trash to confuse me - so I'd like to delete them immediately. Other cases include deleting a very large file that I am certain I don't need it and I don't want it to eat up precious space on my Solid State Drive.

Please let me know how I can make a finder contextual menu in 10.6 - that's exactly what I am looking for. Greatly appreciate.

Nov 27, 2009 10:38 PM in response to Wanderzhuanyou

ok then. start automator and choose to make a service. set the service to accept files and folders and be available in finder.
the service itself should consist of the following "run shell script" action

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
for f in "$@"
do
rm -rf "$f"
done</pre>

set this action to pass input as arguments. save the service and call it, say, "nuke-it". now select several files/fodlers in finder, right-click and choose "nuke-it".
Note however, that this will delete the selected items completely and without any confirmation dialogs. to avoid mistakes I would put in at least some protection in this. click on the "options" at the bottom of the 'run shell script action" and check the box "show this action when workflow runs". this way you will at least have to click "continue" after invoking the "nuke-it" contextual menu.

the end result should look like this
!http://img692.imageshack.us/img692/8944/nukeit.png!

Message was edited by: V.K.

Nov 27, 2009 11:25 PM in response to Wanderzhuanyou

I gave you the Terminal command because there isn't a Finder one. No need to navigate to the file via Terminal, just drag & drop it into the Terminal window and the path is automatically included. However, that said, I strongly recommend that you change your ways: *the trash isn't a repository, it's for things you want to get rid of, not save for later inspection.* That's a bad windoze habit, break it!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Delete a file without moving it to trash

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