how to delete locked folders/files
How to delete locked folders/files? When I try to delete them an error occurs: "Error removing file: Permission denied" I am root. See the image below to know what kind of folders/files.
thanks
Solution 1:
Launch your file explorer as root using:
gksudo nautilus
This will open your file explorer, and grant it root, so it should be able to view/delete the directory/file.
If you are like me, and don't care about the warnings in this question you can use this instead:
sudo nautilus
Solution 2:
Try the following: launch Terminal and enter
sudo rm -rf '/path/to/locked/folder'
And be VERY careful with the path to folder!
Solution 3:
Steps:
- Open Terminal.
-
Run command:
sudo su
- Command above would ask for your password.
-
Once the correct password is given, you would give following command.
chmod a+rwx folder/file
and go to home and just delete the folder/file.
Exit for root user type
exit
.
Solution 4:
The lock symbol means your user currently have no write permission on the file/folder. To change this:
- Check the current owner/group/permissions status by right clicking the file/folder, clicking
Properties
and then switching to thePermissions
tab. - Open a
Terminal
by hitting Ctrl+Alt+t.- If you are the
Owner
of the file (i.e. theOwner
field shows your username): add write permission to the owner by running this command:chmod u+w <path_to_file_folder>
- If you are not the
Owner
of the file, but you are in theGroup
group (i.e. theGroup
field shows your username or a name of a group to which you belong, e.g.sudo
): add write permission to the group by running this command:sudo chmod g+w <path_to_file_folder>
- If you are not the
Owner
of the file and you are not in theGroup
group: add write permission to the others by running this command:sudo chmod o+w <path_to_file_folder>
- If you are the
- Run
exit
And then just delete the file/folder from Nautilus
.
Alternatively:
- Open a
Terminal
by hitting Ctrl+Alt+t.- Remove the file/folder as
root
by running this command:sudo rm -rf <path_to_file_folder>
- Remove the file/folder as
Solution 5:
Here is something , that I found was easier to do instead of opening terminal. Right-Click the file and open properties. Then switch to the permissions tab. Then wherever it says Access: change it from whatever it is to Create And Delete Files. This should remove the lock and then you can delete the file normally.