0

Suppose I have myDirectory which contains files and directories and I issue the command...

chmod --recursive a-w myDirectory

nautilus will display a padlock on the icon of myDirectory. There is no padlock on the directories within it. Why not?

H2ONaCl
  • 9,693
  • The Nautilus file manager indicates that the directory is read-only, which means that you cannot modify or delete any file or subdirectory within that directory. It does not indicate the permission of the files and subdirectories within the directory.

    You can verify the permissions of the directories within myDirectory by running the ls -l command in a terminal or by checking their properties in Nautilus.

    – Ender Apr 10 '23 at 09:18
  • @Ender Why doesn't a read-only subdirectory have a padlock? – H2ONaCl Apr 10 '23 at 12:58
  • A read-only subdirectory means that the files within that directory can be viewed, but cannot be modified or deleted. The lack of a padlock on a read-only subdirectory reflects a different ways a file or a directory can be protected – Ender Apr 12 '23 at 16:55
  • @Ender but they're not protected in different ways. Before issuing the command the permissions on myDirectory are drwxrwxr-x which is the same as the permissions on myDirectory/subDirectory. Then after issuing the command the permissions are dr-xr-xr-x for both myDirectory and myDirectory/subDirectory. – H2ONaCl Apr 13 '23 at 16:48
  • @H2ONaCl, your observations are correct: Nautilus appears to only show a padlock on parent folders, while sub-folders (though inheriting the same permissions) do not. As an exercise, you can create a series of nested folders (e.g., mkdir -p test/test1/test2), and then set the test2 folder to limited permissions. The result is that you'll see that folder with a padlock. However, if you move up to its parent (test1) and then limit permissions there, the padlock icon on test2 is gone, and the padlock is now on test1. Seems to be a strange design thing... or a bug. – richbl Apr 16 '23 at 19:48

0 Answers0