Clarifications on chmod symlinks behavior
chmod(1) says:
-R |
Recursively descend through directory arguments, setting | |
the mode for each file. When symbolic links are encoun- | |
tered, the mode of the target file is changed, but no | |
recursion takes place. |
Take the following example (ll is ls -lh):
# ll -d /var/sample
lrwxrwxrwx 1 root root 17 Apr 4 08:56 /var/sample -> /var/share/sample
# ll -d /var/share/sample
drwxr-xr-x 4 root root 5 Apr 4 08:56 /var/share/sample
# ll /var/share/sample/*
-rw-r--r-- 1 root root 0 Apr 4 08:55 /var/share/sample/s1
/var/share/sample/a:
total 2
-rw-r--r-- 1 root root 0 Apr 4 08:56 a1
-rw-r--r-- 1 root root 0 Apr 4 08:56 a2
/var/share/sample/b:
total 1
-rw-r--r-- 1 root root 0 Apr 4 08:56 b1