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.

Is there a way to QUICKLY empty the trash?

When throwing out, say 250000 items, it can take a LONG time. First you wait for the "Preparing to empty the Trash..." and then you suffer through "Emptying the Trash..." My question is, "Is there a quick way to do this?", and if not "Why not?"

Years ago there was the ability to hold down something like the option & command keys while emptying the trash, and it emptied very quickly, but either I've forgotten the key combination, or it's just not allowed anymore.

Having a quick way to empty trash would be very helpful when performing operations such as,
1) clearing an external drive of most (but not all) data
2) removing a very large iPhoto library (or libraries)
etc...

Although I've searched dilegently for an answer to this, all I've found are suggestions to us the "erase" command in Disk Utility or the rm command in terminal. The erase command is useless if you want to keep files on the disk, and the rm command doesn't seem to provide a speed improvement, at least in my hands.

Thanks

17" MacBook Pro 2.4GHz, 4GB, 160GB, Mac OS X (10.5.6), Time Machine

Posted on Apr 13, 2009 9:37 PM

Reply
34 replies

Jun 6, 2009 6:36 AM in response to KJK555

KJK555 wrote:
open terminal.app
at the prompt type in the following command:
sudo mv ~/.Trash ~/Desktop/Trash
(press return, enter admin password, press return again.)

Logout, then log back in (a new ~/.Trash file will be created).
Your trash can will now be empty and all your old trash files will
be on your desktop in the new "Trash" folder.


When I tried this, the new Trash folder on the desktop was empty and the "real" Trash folder in the dock still has thousands of files.

I must be missing something.

Jun 6, 2009 12:10 PM in response to John.B

If your trash files are actually located somewhere other than your home directory, then they will be
found there in the .trashes directory in the root directory.
In other words if you have your data on a second drive or even another partition on your boot
drive, your discarded files (from the data volume) will go into the .trashes directory on the root
of that drive.

The Finder actually looks in all the available mounted volumes in their assigned .trashes directories
for files that are available for deletion.

If you have multiple volumes mounted, you will have multiple trash locations. Files put in the trash
from each volume goes in its assigned .trashes folder in its root directory, since these are invisible
folders to the Finder, I suggest using tinker tool or some other similar utility to temporarily reset
finder to display invisible folders so you can easily locate your trash files.

You can still use my method to delete the trash, but you will have to use the mv command to rename
the .trashes folder on the SAME volume that the .trashes folder is on to avoid causing it to jump
into copy/remove mode. Files and folders on the same volume can be moved around using a
simple inode rename process, but if you try to move them to a new volume they will physically
have to be copied to the new location and removed from the old, thus taking considerably more
time.

Say you have a volume named "data" and you find thousands of files in its .trashes folder.
This would be the way to get rid of it with rsync:

1. Create an rsync folder at the root of drive "data", place a single file in it.

2. open terminal and use the mv command to rename the .trashes directory:
sudo mv /Volumes/data/.trashes /Volumes/data/Trash

3. Now use rsync:
sudo rsync -av --delete /Volumes/data/rsync/ /Volumes/data/Trash

That's it!

Kj

Jun 6, 2009 1:08 PM in response to nerowolfe

That is true, but echo is not an integral part of rm, it is a separate command that passes output.
Using echo allows you to expand the wildcards to understand what will happen before you actually run the command.
Uninhibited though, the rm command is great tool for cleanliness. In one little keystroke it can cause
a stream of tears to wash away the dust from your backups, or if you don't have backups, It may
set in motion a small flood of tears that you can mix a little soap with and clean the floor. 🙂

Kj

Jun 6, 2009 1:15 PM in response to KJK555

KJK555 wrote:
That is true, but echo is not an integral part of rm, it is a separate command that passes output.
Using echo allows you to expand the wildcards to understand what will happen before you actually run the command.
Uninhibited though, the rm command is great tool for cleanliness. In one little keystroke it can cause
a stream of tears to wash away the dust from your backups, or if you don't have backups, It may
set in motion a small flood of tears that you can mix a little soap with and clean the floor. 🙂

Kj

Yes, which is why the experts are experts and do not do rash things in a terminal, especially as root. And no expert would ever use a computer without a backup or two.

Red Adair, the late, great Texan who put out huge oil fires said, when asked why he charged so much, "If you want to find out what it really costs, hire an amateur." 🙂

Jun 6, 2009 1:37 PM in response to doug pennington

That is something I cannot answer.
As I noted, I empty the trash regularly. The trash is basically always empty.
Trash, when left around begins to rot and stink.
I consider unkempt trash bins akin to cluttered desktops, full of random junk, most never used, and making it difficult to find anything. Apple recommends not using the desktop for casual storage.
They don't mention trash, because it's rather obvious that it should be emptied very regularly.
Both the desktop and the trash are special directories on BSD and should not be abused.
Good housekeeping is something to be learned. It's not genetic. 🙂

Message was edited by: nerowolfe

Jun 6, 2009 9:47 PM in response to doug pennington

doug pennington wrote:
But the bottom line is: Why did the guy make a landfill out of a trash can?

If you are talking to me, in a fit of distractedness I sent an incomplete TM backup subdirectory to the trash after the backup hung. I only run TM backups daily (I use weekly SuperDuper drive cloning as my main recovery point) and in between I had deleted several unused applications, run Monolingual to delete a crapload of unneeded language support files, followed by reinstalls of Elements and Office 2008 (that don't play nice with software updates after having their language files screwed with). Mea culpa.

Kj, your advice to check the .trashes directory in the root directory was right on the mark. Much appreciated, I learned a few things today!

Jun 6, 2009 10:39 PM in response to John.B

Hi John.B:
Glad to help.
Whenever possible, you should instruct Time Machine to delete its own files. Time machine uses a
barrage of ACL's when it does a backup, making it all but impossible to delete the TM backup files
by simply dragging them to the trash. Even when you think they are gone, the inodes remain locked
and the disk space the file occupied stays locked and unavailable. Sometimes the only way to get the
disk space back is to erase the volume.

If you must for some reason manually delete the TM backup, then take it apart piece by piece
starting from the back end (the backup files) working toward the front (the Backups.backupd
folder), removing ACL's as you go using the chmod -R -N command. When you finally work your
way to front, any top level folders with dates have to be renamed and the Backups.backupd folder
have to be renamed and ACL's removed before they can be properly deleted.

Kj

Is there a way to QUICKLY empty the trash?

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