chown
- 所有者変更
--no-dereference
current
-rw-r--r-- 1 apache apache 0 Dec 4 09:57 test01 -rw-r--r-- 1 root root 0 Dec 4 09:57 test02 drwxrwxrwt. 18 root root 4096 Dec 4 09:57 .. lrwxrwxrwx 1 root root 6 Dec 4 09:58 test03 -> test01 drwxr-xr-x 2 root root 4096 Dec 4 09:58 .
何も考えずに、test03 を chown してみるとシンボリックリンク先が nginx に変更され、test03 の所有者は変更されてない
# chown nginx: test03 # ls -lart total 8 -rw-r--r-- 1 nginx nginx 0 Dec 4 09:57 test01 -rw-r--r-- 1 root root 0 Dec 4 09:57 test02 lrwxrwxrwx 1 root root 6 Dec 4 09:58 test03 -> test01 drwxr-xr-x 2 root root 4096 Dec 4 09:58 . drwxrwxrwt. 18 root root 4096 Dec 4 09:58 ..
オプション --no-dereference 付けてみると test03 のみ所有者が nginx になる
# chown --no-dereference nginx: test03 # ls -lart total 8 -rw-r--r-- 1 apache apache 0 Dec 4 09:57 test01 -rw-r--r-- 1 root root 0 Dec 4 09:57 test02 lrwxrwxrwx 1 nginx nginx 6 Dec 4 09:58 test03 -> test01 drwxr-xr-x 2 root root 4096 Dec 4 09:58 . drwxrwxrwt. 18 root root 4096 Dec 4 09:58 ..