linux 修改软链接属主和群组

前言

我们知道,linux有一种文件类型叫做链接,用"l"(link)来表示。

我们使用的比较多的是软链接,相当于windows中的快捷方式"

规定它的属主,就一定要用chown -h参数来做,否则做不成功。

正文

先来看一下chown的-h选项是个什么东西:

-h, --no-dereference
              affect  symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink)

意思就是,如果加了-h参数,就只会影响符号链接,而不会影响到符号链接的目的文件或文件夹。

我们看个例子:

这里没有使用-h,就没有生效。

加了-h, 就有变更。

猜你喜欢

转载自www.cnblogs.com/young233/p/12600527.html
今日推荐