12

chown has an option -L which tells chown to traverse symbolic links. It seems this option is missing for chmod. Any idea how to tell chmod to follow symlinks as well?

EDIT: I'm on Debian.

2
  • 1
    You should mention that it's Linux or some other system. I was confused because FreeBSD has got -L for both commands. Sep 15, 2016 at 18:29
  • true, I'm on Debian.
    – Aley
    Sep 16, 2016 at 9:49

1 Answer 1

12

For Linux/GNU see the second paragraph of the info page also on the Web, emphasis added:

chmod never changes the permissions of symbolic links, since the chmod system call cannot change their permissions. This is not a problem since the permissions of symbolic links are never used. However, for each symbolic link listed on the command line, chmod changes the permissions of the pointed-to file. In contrast, chmod ignores symbolic links encountered during recursive directory traversals.

1
  • 6
    Okay so chmod ignores symbolic links encountered during recursive directory traversals. So chmod is not capable of it. So propably I have to use find -L in combination of chmod.
    – Aley
    Sep 18, 2016 at 17:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .