I am trying to create a script to empty the root's Trash, but am coming up with permission issues. If I am logged in as root, I can use the following command to empty the trash:
Code:
rm -r /root/.local/share/Trash/files/* /root/.local/share/Trash/info/*
But, if I try it as a sudoer I get the following output:
Code:
rm: cannot remove `/root/.local/share/Trash/files/*': No such file or directory
rm: cannot remove `/root/.local/share/Trash/info/*': No such file or directory
I tried accessing /root/.local as a normal user with nautilus, but it says that I do not have permission to view the folder (in the shell it just says that the folder does not exist). Is there some way to empty root's Trash using "sudo", so that I can finish my script?