Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Authored by: lullabud on Apr 05, '05 02:07:59PM
If you're comfortable with the there's an even quicker way to do this.

rm -r ~/.Trash/*

That's only for trash on your local disk though. Trash on other disks would need to be done with something such as...

rm -r /Volumes/FirewireDisk/.Trash/*

Be careful with that command though! It's widely known to cause big headaches (ie: important data loss) if typed wrong!

[ Reply to This | # ] (and rm)
Authored by: tjfarrell on Apr 05, '05 06:05:09PM
This gets rid of the file's directory entry - but only gets rid of the actual file if nothing has it open. This may be what you want (trash will empty now), but don't expect to always get your disk space back right away. If the file is really open it is only deleted when it is closed (see "man unlink" for details) .

To work out if something has it open, you can probably use the "ls -i" command to get the inode of the file and then use "lsof" to find what has it open. For example

    > cd .Trash
    > ls -i filename
    2808535 filename
    > lsof | grep 2808535

This should tell you the name of the program with open.

(There are many other options to lsof which may help - I haven't had a good look at them, but beware that since you trashed the file, its name may have changed - I don't know if lsof reports the original file name or the current file name)

T. Farrell

[ Reply to This | # ]

Emptying stubborn trash with
Authored by: rpcr on Apr 06, '05 08:56:07AM

You want to put a sudo in front of both of those - the whole reason the trash won't empty is because some process has the trashed file(s) open.

An ordinary user can't override these other processes' need for the trashed file, but the superuser can.


sudo rm -r ~/.Trash/*

[password requested and entered]


sudo rm -r /Volumes/MountedVolumeName/.Trashes/*

[password requested and entered]

Oh, and notice that the volume-wide trash for volumes (both mounted in the /Volumes directory, and the boot volume, /) is .Trashes, not .Trash. Only user home directories use .Trash as the trash directory.

[ Reply to This | # ]