0

I have some folders and files that do not get deleted in the trash folder.

I logged in as root using sudo su then rm -rf ~/.local/share/Trash/files/* but nothing happens.

Can anyone help with a step-by-step solution please?

  • You DO NOT want files in the trash to be deleted? But the rm command you're trying to run is to delete the files. Can you clarify what you're trying to do? – Dorian Jul 19 '16 at 14:26
  • I do want the files deleted. – FlavioZ Jul 19 '16 at 18:03
1

root's Trash directory?

I assume you want to empty your user's trash, not root's. If you "sudo su" then "~" will (probably[0]) expand to "/root", which is unlikely to be what you meant.

Why are you using sudo to do this anyway?

If you need to be root (for some reason) to delete these files, try:

sudo rm /home/<username>/.local/share/Trash/files/*

or similar.

[0] whether it does or not depends on how much of the environment gets inherited when sudo is run, but I think by default it does

| improve this answer | |
  • All I get is: rm: cannot remove ‘/home/<my username>/.local/share/Trash/files/pt7sNdLvbt’: Is a directory rm: cannot remove ‘/home/<my username>/.local/share/Trash/files/XMKx-BRJn1’: Is a directory – FlavioZ Jul 19 '16 at 17:54
  • rm -rf /home/<username>/.local/share/Trash/files/* .... I.e. the rm -r command is to be used for deleting folders. – Knud Larsen Jul 19 '16 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.