How to remove files with no permission
I have leftovers of PyLotRO, a Windows emulator, but I can't move all files to the trash bin.
How do I change permissions and delete them?
3 Answers
Determine where the folder is and change the permissions using chmod
sudo chmod -R 777 /path/to/folder/foldernameThen press Enter. For example if the folder was called BLAH and was located at /home/user then you would type
sudo chmod -R 777 /home/user/BLAH That should change the permissions for the folder and all its files and sub directories to read/write/execute. Then you should be able to delete them. Also be aware that Linux is case sensitive so you do have to use a capital -R in the line and if your directory has caps you have to use caps the exact same way it show or it will fail
Since you said you can find the folder in terminal you can use this command
sudo rm -rf /path/to/folder/foldernameThat will delete the folder and its subdirectories as root.
It will ask you for a password and when you type it in it will look like nothing is happening . It doesn't show any indication that you are typing it in. Just type the password and press Enter and it will delete the files for you.
3Having all permissions as a root, you should use:
sudo -iAnd for completely removing files or folders and their contents, you can use:
rmFor obtaining more information about these commands (and other commands!) you can use:
manFor example,
man rm If you wanted to use your GUI file manager (nautilus, thunar, caja, dolphin, etc) you could use the "root account" to delete the files.
Most file managers probably have an "Open Folder as Root" or similar option, or just run the file manager with sudo (, from a terminal would work.
For thunar: sudo thunar. Or for nautilus: sudo nautilus , etc
If you're using nautilus, the answers here should help: How do I open a folder as root?
Then browse to the offending files and delete them.
In a terminal, just sudo rm should work too