Sunday, May 17, 2009

Force Empty Trash

Sometimes you might face a problem where you can't delete files in the Trash (due to permission issues), I solved this problem by doing the following:
  1. Go to directory ".local/share/Trash/" by typing "cd .local/share/Trash"
  2. Execute this command: "sudo rm -rf file_name"

9 comments:

BooDy said...

the permissions problem often happens when you try to remove a file that is not yours

i mean, try to list your files using
ls -l
you may have the permissions set as 777 which is:
-rwxrwxrwx root root file_name

but yet you're not the owner

you can solve this problem using this command:

chown username:username file_name
(note that you'll have to replace "username" with your user name)


anyway, i just wanted to tell the problem causes ... (as it happened to me earlier)

you got a nice blog over here :)
keep it :)

SoCRaT said...

Thanks BooDy for your comment, I just didn't know where to find the Trash files are located :)

SoCRaT said...

BTW, When are you going to graduate BooDy?

BooDy said...

that would be next year ... 2010
hope so :D

SoCRaT said...

OK, just let me know when you do :)

BooDy said...

i'll try not to forget that -isa- :D

but may i ask why?! :)

mhewedy said...

I think this doesn't work in all Linux distributions.
for example on RHEL3.0 this file doesn't exist in this location.

and when i do that :
cd ; find ./ -iname *trash* 2>/dev/null
It returns no results to me

SoCRaT said...

I guess you'd better run the following command as the super user:

find / -name "*"trash"*"

mhewedy said...
This comment has been removed by the author.