Change Owner of Symlink in Linux

Category:

When you use chown to change ownership of a file or directory, it will work but with Symlink (Created by using ln command), you can't do that. When you do it, it will fail and you may not know that since there is no error message or anything to let you know. So, to change ownership for Symlink, you need to use option -h. Below is an example :

chown -h user:group symlink

Be careful when you use it with directory. Not to have trailing slash (/) at the end or it won't work. So, if you have a Symlink directory name munin What you have to do is :

chown -h root:root /var/www/munin

not

chown -h root:root /var/www/munin/

Comments

I think this is a better than average article. You make this data intriguing and locks in. You give per-users a ton to http://www.assignmentbrief.co.uk consider and I welcome that sort of composing

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.