Can't access /root/.local as normal user
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/* Code:
rm: cannot remove `/root/.local/share/Trash/files/*': No such file or directory |
It appears that your script is telling 'rm' to remove the file "/root/.local/share/Trash/files/*", the star ('*') is not acting as a glob, but instead being taken as the name of a file (which of course does not exist).
I dont know why your script would act that way, so a quick fix would be to tell 'rm' the name of a actual directory to remove. |
Thanks for the reply. I found an answer at ubuntuforums.org:
Code:
sudo bash -c "exec rm -r /root/.local/share/Trash/{files,info}/*" |
All times are GMT -5. The time now is 10:32 PM. |