Whenever I open my documents, all the folders in it are displayed with a lock icon. Therefore, I cannot delete any file or folder in it.

I tried changing the root access using sudo chmod user:directory/ but it fails. I am not able to delete or perform any file action with it.

What action should I perform to fix it?


Solution 1:

Run the following to fix your home directory permissions:

sudo chown -R $USER: $HOME

Solution 2:

sudo chmod 777 -R /path to folder you want to delete- This would give all permissions (Read, Write, Execute) to you

The permissions (in this case 777) are as follow:

  • 7 - Full (Read, Write & Execute)
  • 6 - read and write
  • 5 - read and execute
  • 4 - read only
  • 3 - write and execute
  • 2 - write only
  • 1 - execute only
  • 0 - none

First number change Ownership of file, second affect Group of users can access, and third refers to Others user.

Owner   Group   Other
  7       7       7

after changing the permission, try and delete the folder.