4
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.
4
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.
4
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.
3Okay 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 – 2016-09-18T17:19:53.827
You should mention that it's Linux or some other system. I was confused because FreeBSD has got
-L
for both commands. – Martin Sugioarto – 2016-09-15T18:29:04.070true, I'm on Debian. – Aley – 2016-09-16T09:49:10.040