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.

How do I delete files & bypass the Trash?

Is there a way to completely remove files from my system without moving them to the Trash?


AND


I've read about the Trash, but I'm not clear on EXACTLY how it works. Can I empty A file from the trash or when I click on a file & choose "Emtpy the Trash" does it empty ALL of the files in the Trash or just that one file?


Is there a way to just empty ONLY 1 file from the trash or restore ONLY 1 file from the Trash if so how?


ALSO, what are the "rules" for MOVING files rather than COPYing them? I thought files that went from one folder to another on the same drive, were moved & ones that went to different drives were copied. It seems like I've run acrorss instances where that's not how things work.

Mac Pro, Mac OS X (10.6.8)

Posted on May 5, 2012 9:16 AM

Reply
Question marked as Best reply

Posted on May 5, 2012 9:57 AM

To delete a file or folder without moving it to the Trash, open Terminal in Applications>Utilities and copy/paste


sudo rm -rf


Then, important, leave a space after the -rf and drag the file or folder into the Terminal window -- it will then appear with the path of that file or folder -- and hit return. You will be asked for your admin password -- nothing will appear as you type it in -- and given a warning about using the sudo command, if this is the first time using sudo.


Note: the rm command, especially run with sudo (sudo gives you root access) is a very dangerous command; it must be used with great care. No second chances.


You cannot selectively empty the Trash. It's all or nothing. If you want to Trash a single file or folder, then move all the other ones you don't want to empty out of the Trash.


AFAIK, dragging a file from one volume or drive to another should leave the original in place and move a copy over. I've never heard of any exceptions. However, if you are dragging a file or folder over using the Finder, I don't think the Permissions for the copy will necessarily be preserved, except for files or folders moved within your user, where your user is already the owner. Even within your user, the owner may be changed to your user, even if you are not the owner.


Outside of your user, the permissions will be changed to reflect your user as owner, which will be wrong. So it's not a great way to copy over anything from /Library or /System/Library using the Finder, where the owner should be system or root, or other, not your user. If you do this, it's probably then a good idea to repair Permissions, so they are restored properly. That said, Permissions repair will not touch anything in your user.


Moving things with the Finder isn't always the best way to do this.

27 replies

Aug 29, 2014 11:36 AM in response to WZZZ

Just wanted to say a big "Thanks" - was stuck with a "greyed out" 320 GB file on my backup drive which wouldn't delete.

Took me some time to realise it was simply too big to fit into Trash (not enough space on my laptop hard drive to

allow this.


Your instructions worked perfectly - took maybe 8 minutes to delete. I do use Time Machine but also use a backup in case

I want to just access a single file or in case I lose the mini hard drive to which I have copied large resource files to in order

to clear my laptop drive a bit.


I also hadn't known that I could just drag a file to the Terminal window to enter its path name in Terminal - very useful.


I moved to Apple 2 yr ago from RISC OS and have never really found the time to work out how anything but the basics work.

Jan 30, 2015 9:44 AM in response to Király

"To delete a single item from the Trash, move everything out of the Trash that you don't want deleted, and then empty the Trash. Don't put files in the Trash that you are wanting to keep. Create a "purgatory" folder to stash files that you think you no longer want but can't bring yourself to delete just yet."

Wouldn't it be a million times easier if Apple just let you delete individual items from the trash like Windows does?

I throw stuff in the trash throughout the project I'm working on. But I don't feel comfortable deleting it until the project is done with no problems. There's no way to easily right-click, or Cmd-delete files, to send them to a purgatory folder. So instead I'd be constantly dragging files into that purgatory folder.

Jan 30, 2015 9:57 AM in response to Matt Savino

Well, the trash is the trash. Things you know you don't want, not a place to put things you may still need.


Like a real trash can, you can pull things out. But otherwise, if you take the trash out, you take out the whole thing, not just parts of it.


Yes, it is nice Windows lets you be more selective, but as I already noted, if it's something you think you may still need, it shouldn't be put in the trash in the first place.

Jan 30, 2015 10:22 AM in response to Kurt Lang

I don't get this attitude at all. Why is it *wrong* to use a product the way I want?


Lots of people use the trash as a staging area for getting rid of things, otherwise why does it even exist? If I could easily right click or Cmd-delete and and send things to purgatory I would do that. But opening finder and dragging things around is very often a PITA. Also if they gave you a keyboard shortcut to permanently delete something, instead of going to the terminal as your only option, that would help alleviate this problem.


As an example, it used to be that you could not cut and paste files or folders on Mac (which you could do on Windows). Interestingly you could copy and paste files and folders. Sometimes dragging and dropping from nested folders into other nested folders can be a real pain--with folders popping open willy nilly. I posted a query about that on a forum somewhere and got a very similar answer. That it was somehow semantically wrong to cut a file. What did that even mean? What happened if you never pasted it? Nope, it was just *wrong* to want to cut and paste a file.


Well Apple apparently decided my needs as a consumer did outweigh their idea of right and wrong, and now I can cut and paste folders and files. I just wish they would do the same with deleting from the trash. Or at least give me a way to fully delete something w/o having to go to the terminal.

Jan 30, 2015 10:42 AM in response to Matt Savino

I don't get this attitude at all.

Attitude? I did say it's nice that Windows allows that, didn't I? I have no idea where you got the notion of right or wrong in anything I said. I stated facts, nothing more.


Let's put more bluntly then. The Mac OS isn't Windows. You can't force it to do something that isn't in its code to allow it to do what you want. This is the way the trash in the Mac OS has always worked and is highly unlikely to change.


You can post feedback to Apple if you want about the option to include such a feature in the future, but there's nothing anyone here can do or suggest that would change the hard wired manner in which the trash currently works.

Mar 7, 2015 7:01 AM in response to bamim2

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...!

Apr 18, 2016 4:32 AM in response to Eddu Vaz

I'd like to add one thing to this discussion. There is a way to bypass the Trash and immediately remove a file using a GUI, but it costs some money. Purchase Pathfinder from Cocoatech. (http://www.cocoatech.com/pathfinder/ I've been using it for years, and it is such an improvement over Finder that I can't imagine life on my Mac without it! Path Finder differentiates between moving an item(s) to the Trash or immediately deleting it. It also has a much more powerful and useful interface than Finder.


I realize that this isn't an inexpensive solution, but it will do what you want without resorting to Terminal. For me, considering all it does, it was well worth the price and literally changed my productivity on my Macs. Check out their home page and see if it might be a solution for you. BTW, I do NOT work for Cocoatech and have no relationship with that company at all other than I appreciate their software.

How do I delete files & bypass the Trash?

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