4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

シンボリックリンク自体のオーナーを変えるにはchown -h オプション

Posted at

シンボリックリンクのオーナーを変えたいのに、幾ら chown を叩いても全然変わらない。
と思ったら、リンク先のオーナーが変わってた。

  • symbol のオーナーを変更すると、entity のオーナーが変わる
[]~/tmp: ll
total 8
-rw-r--r--  1 root  _avuxupdate  0 10 24 13:15 entity
lrwxr-xr-x  1 root  _avuxupdate  6 10 24 13:15 symbol@ -> entity
[]~/tmp: sudo chown mysql:mysql symbol
[]~/tmp: ll
total 8
-rw-r--r--  1 _mysql  _mysql       0 10 24 13:15 entity
lrwxr-xr-x  1 root    _avuxupdate  6 10 24 13:15 symbol@ -> entity
  • chown -h オプション を使うとリンク自体のオーナーを変えられる
[]~/tmp: sudo chown -h mysql:mysql symbol
[]~/tmp: ll
total 8
-rw-r--r--  1 _mysql  _mysql  0 10 24 13:15 entity
lrwxr-xr-x  1 _mysql  _mysql  6 10 24 13:15 symbol@ -> entity
4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?