OSX Trash

Ensign Paris

macrumors 68000
Original poster
Nov 4, 2001
1,781
0
Europe
Hi

Can anybody give me a quick way to empty the trash from the terminal?

I have about 7000 files which take about 10gb of disk space up on my pb and I want to get rid of them, but I do not own them!

I guess the terminal can do this (Root didn't work!)

TIA

Ensign
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,219
0
San Diego, CA
I don't know abou the Terminal but there's a shareware/freeware app called BatChmod (look on versiontracker) that has a "Force Empty Trash" command built in. Hope this helps!
 
Comment

Mighty Mac

macrumors member
Jan 10, 2002
40
0
Just switch to root you will own all and should be able to delete everything from the trash. If you are not confortable with being root, just empty the trash and logout.
 
Comment

Taft

macrumors 65816
Jan 31, 2002
1,319
0
Chicago
Its not too hard...

Just cd to the .Trashes directory on the volume you want to empty the trash from. The directory is on the root level for the volume that OS X is installed on. In the .Trashes directory you should see user folders named by the user id number (501, 502, etc). If you are the only user, you'll only see one. cd into the numbered directory (ls to make sure its the right directory--look for the stuff you have to delete) and then sudo rm everything. Like this:

%cd /.Trashes
%ls
501/
502/
503/
%cd 501
%ls
junk.txt
junkdir/
%sudo rm -rf *

Be careful with the sudo rm command as you can trash your system with it. To be safe close the terminal window after the command has successfully completed.

I'm typing this from memory, BTW.

Matthew
 
Comment

Ensign Paris

macrumors 68000
Original poster
Nov 4, 2001
1,781
0
Europe
Originally posted by Mighty Mac
Just switch to root you will own all and should be able to delete everything from the trash. If you are not comfortable with being root, just empty the trash and logout.
I am happy with the root user name, infact my life would be hell without it (I love fiddling with the OS) but the Root does not list the trash for my admin user name.

Thanks for everyones help!

Ensign
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.