Page 1 of 1

can't delete files in trash

Posted: Wed Dec 12, 2012 4:39 pm
by bmike1
I run mint 13 and there are things in the trash bin that won't remove. The status bar appears and everything disappears except 13 folders (that are empty). Where is the trash bin in the network tree?

Re: can't delete files in trash

Posted: Wed Dec 12, 2012 5:20 pm
by overthetop
Try

Code: Select all

sudo rm -rf ~/.local/share/Trash/files/* ~/.local/share/Trash/info/*

Re: can't delete files in trash

Posted: Wed Dec 12, 2012 5:28 pm
by xenopeek
There may be some files or folders in your trash that you don't own and so can't empty from the trash. Open a terminal and run the following command, to change ownership of everything in the trash to yourself. You should then be able to empty the trash. You can copy text to/from the terminal, see its Edit menu.

Code: Select all

sudo chown -cR $(id -un):$(id -gn) ~/.local/share/Trash/@(files|info)/*
Edit: you may also try overthetop's command. When I tried that just now it did delete files in my trash, but when I then opened my trash in the file browser the files were still there. Hence my more cautious approach. overthetop's command may work fine, but you may have to log out and log in again to clear any confusion your file browser may have over the state of the trash.

Re: can't delete files in trash

Posted: Thu Dec 13, 2012 1:31 pm
by bmike1
Thanks for the quick responses.
Vincet, your command errored out while overthetop's command didn't do anything.
After looking at your explanation again it seems I'll have to log out/in for the changes to take effect but I don't want to do that yet

bmike1@Michaels-Laptop:~$ sudo chown -cR ${id -un}:${id -gn} ~/.local/share/Trash/@(files|info)/*
bash: ${id -un}:${id -gn}: bad substitution
bmike1@Michaels-Laptop:~$ sudo rm -rf ~/.local/share/Trash/files/* ~/.local/share/Trash/info/*
[sudo] password for bmike1:
bmike1@Michaels-Laptop:~$

Re: can't delete files in trash

Posted: Thu Dec 13, 2012 1:41 pm
by xenopeek
Doh. Typo on my end. I've corrected the command in my post above.

But the overthetop's command should have cleared your Trash, though you can't see it yet as your file browser has a cache.

Re: can't delete files in trash

Posted: Thu Dec 13, 2012 1:52 pm
by DrHu
If you have deleted the files in your trash folder, but they still appear in your file manager
--you probably at least have to logout/login to get a new session for the file manager with the updated status of your trash folder..
  • You could also crash/restart the Xserver (ctrl alt bksp key combination); it should require a re-login of the session..

Re: can't delete files in trash

Posted: Mon Jan 28, 2013 3:03 pm
by bmike1
thanks for the help guys!

Re: can't delete files in trash

Posted: Wed Oct 17, 2018 5:39 am
by antonymonteiro
overthetop wrote: Wed Dec 12, 2012 5:20 pm Try

Code: Select all

sudo rm -rf ~/.local/share/Trash/files/* ~/.local/share/Trash/info/*
This command solved my problems..