Empty Trash in terminal window?

Joined
Sep 25, 2015
Messages
396
Reaction score
10
Used to be easy to do this, with "rm -r /Users/myaccount/.Trash"

Now that I've moved beyond ElCap, that doesn't work anymore. You can do it with sudo rm -R, and then drag everything from the trash to the terminal window. But I want to do it ALL with ONE TERMINAL COMMAND and no dragging.

Options?
 
Last edited:

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,106
Reaction score
497
Hi,

I only had to force empty the Trash via Terminal once years ago. Sounds like something has changed due to SIP, APFS, and other new macOS security features being implemented?

I have been using two keyboard commands for moving files to the Trash, then emptying it:
Command-Delete to move selected file(s) to the Trash
Command-Shift-Delete to empty the Trash

Of course, that doesn't help if the Trash cannot be emptied and you have to force empty it. I know there are a few applications that manage the Trash, but I haven't used any of them. It looks like the process you listed is how it works in Terminal now. I did a quick search and didn't see a faster way.

C
 
Joined
Sep 25, 2015
Messages
396
Reaction score
10
That's slick, thank you your suggestion. I occasionally have to do this terminal empty-trash when the Mac says that a file in my trash is "busy" and it won't delete it with a simple Finder-Empty Trash. In all of these cases the file certainly isn't busy. I've killed the application that I was using to work on them. So this "file busy" business is a delusion of my Mac. I'll try this strategy next time I see something like that.
 
Joined
Feb 14, 2021
Messages
988
Reaction score
131
I remember using Onyx to force-empty the Trash folder. I can’t get into it presently because Onyx is not supported in Monterey.

If you get on the developer’s web site, I think they still maintain copies for older versions of macOS.
 
Joined
Sep 25, 2015
Messages
396
Reaction score
10
The fact that lots of software can't keep up with new Mac operating systems is a MAJOR disincentive to upgrading for me. I'm at Big Sur now, on a new machine (somewhat reluctantly) and I've managed to get more or less experimental beta versions of those software packages that are most important to me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top