I did a stupid thing. I was having issues with certain files in my trash that my system was not allowing my to delete, meaning I could no longer empty my trash. These were not super important files, just theme folders I was creating and ditching. After getting frustrated, I googled it and was led to executing this script sudo rm -rf ~/.local/share/Trash/*
which looks as though it totally removed my trash…completely and now I can no longer add items to it. How can I restore my trash once again? I know it's probably as simple as re-creating the file, but I'm unsure of the terminal language to do this.
Thanks in advance.
TL;DR I removed my trash directory with sudo rm -rf ~/.local/share/Trash/*
and need help getting it back/making a new one.
Best Answer
Try:
... and then restart nautilus with
nautilus -q
. I am not sure it will work, it is just recreating the structure I have with an empty trash; you can safely ignore error about existing directory.Notice, no
sudo
here. The trash is yours, should be manageable without superuser privileges; as a general rule, you should never usesudo
to manage file in your home directory --- unless you have to fix previoussudo
usage, that is.If you have messed with superuser in this dirs, you may need to fix the ownership...
Where
myuser
is your normal user, of course.And BTW, the "not erasable file" was probably a file in another partition.