Removing Desktop directory from opt folder
Andrew Mclaughlin
I've just recently started using Ubuntu 16.4 LTS, converting from iOS. I had just downloaded a file and moved it from the downloads folder to the desktop. I was using the terminal to try to copy it to my /opt folder, but somehow, I copied my entire Desktop to the /opt folder. Now, I can't seem to get rid of the directory since I have insufficient permission. Can anyone help me with this problem? Thank you.
1 Answer
If you managed to copy a folder into a system directory, you should have enough rights to remove it from there.
You can use sudo which gives you root permissions.
e.g. the following command will remove the /opt/Desktop folder
sudo rm -rf /opt/Desktop1
sudo - execute as super user
rm -rf - recursively remove all files of this folder and its sub-foldersNote: please be careful when running
sudo rm -rf /folderas it will remove the content of this folder and all of its sub-folders