- 论坛徽章:
- 0
|
From the man page of \"chown\"\r\n \r\n-h If the file is a symbolic link, this option changes\r\n the owner of the symbolic link. Without this\r\n option, the owner of the file referenced by the\r\n symbolic link is changed.\r\n\r\n既然翻出来了,就试验了几个选项,把几个例子贴出来看看:\r\n\r\n范例\r\n\r\n# ls -l\r\ntotal 12\r\n...\r\nlrwxrwxrwx 1 mc ftptest 8 Nov 17 14:11 test.link -> test.tar\r\n-rw-r--r-- 1 mc ftptest 2560 Nov 6 16:10 test.tar\r\n\r\n更改symbolic link的owner\r\n# chown -h mich:admin test.link\r\n# ls -l\r\ntotal 12\r\n...\r\nlrwxrwxrwx 1 mich admin 8 Nov 17 14:11 test.link -> test.tar\r\n-rw-r--r-- 1 mc ftptest 2560 Nov 6 16:10 test.tar\r\n\r\n更改源文件的owner (缺省行为)\r\n# chown mich:admin test.link\r\n# ls -l\r\ntotal 12\r\n...\r\nlrwxrwxrwx 1 mich admin 8 Nov 17 14:11 test.link -> test.tar\r\n-rw-r--r-- 1 mich admin 2560 Nov 6 16:10 test.tar\r\n\r\n更改源文件的ownership\r\n# chown -R -L mc:ftptest test.link\r\n# ls -l\r\ntotal 12\r\n...\r\nlrwxrwxrwx 1 mich admin 8 Nov 17 14:11 test.link -> test.tar\r\n-rw-r--r-- 1 mc ftptest 2560 Nov 6 16:10 test.tar\n\n[ 本帖最后由 anfield 于 2008-11-17 14:28 编辑 ] |
|