How to Empty Trash if files in there are owned by Root?

Derek Broughton news at pointerstop.ca
Fri Oct 17 00:28:11 UTC 2008


CLIFFORD ILKAY wrote:

> sudo rm -rf /path/to/trash/*
> 
> Be very, very careful about using rm -rf! One finger fumble, for example
> a space after any of the slashes above, and you'll destroy your system.

or a good part of it :-)  I did "sudo rm -r /etc/something/ *" once...

fwiw, the -f option is rarely necessary, and if it _is_ it's often because
you did something boneheaded like that, so when I want to delete an entire
directory tree I just use "rm -r /..." these days.  If it objects to
deleting a file that really should be deleted, it's easy enough to ctrl-c
and add the -f option.

> A better and less dangerous way is:
> 
> sudo chown -R cilkay:cilkay /path/to/trash
> 
> Then, you should be able to empty trash using your GUI or as cilkay doing:
> 
> rm -rf ~/path/to/trash

Yes.
-- 
derek





More information about the ubuntu-users mailing list