免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3282 | 回复: 2
打印 上一主题 下一主题

救助!!如何更改连接文件属性 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-18 01:03 |只看该作者 |倒序浏览
lrwxrwxrwx   1 root     root          20 Nov  1 05:56 log -> /opt/cems/log/bsmlog\r\n想把它改成bsmbin:bsmbin !求高手帮助! 多谢!

论坛徽章:
0
2 [报告]
发表于 2008-11-18 03:05 |只看该作者
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 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2008-11-18 03:06 |只看该作者
chown bsmbin:bsmbin log
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP