can't delete files in trash

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
bmike1
Level 6
Level 6
Posts: 1067
Joined: Mon Nov 28, 2011 1:13 am

can't delete files in trash

Post 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?
:)~Mikey~(:
overthetop

Re: can't delete files in trash

Post by overthetop »

Try

Code: Select all

sudo rm -rf ~/.local/share/Trash/files/* ~/.local/share/Trash/info/*
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: can't delete files in trash

Post 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.
Image
bmike1
Level 6
Level 6
Posts: 1067
Joined: Mon Nov 28, 2011 1:13 am

Re: can't delete files in trash

Post 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:~$
:)~Mikey~(:
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: can't delete files in trash

Post 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.
Image
DrHu

Re: can't delete files in trash

Post 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..
bmike1
Level 6
Level 6
Posts: 1067
Joined: Mon Nov 28, 2011 1:13 am

Re: can't delete files in trash

Post by bmike1 »

thanks for the help guys!
:)~Mikey~(:
antonymonteiro

Re: can't delete files in trash

Post 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..
Locked

Return to “Other topics”