change owner of the file

October 2nd, 2006 mysurface Posted in Admin, chown | Hits: 38916 | 2 Comments »

chown is a simple admin command that use to change the owner and groups on specified file. The simple syntax looks like bellow:

chown OWNER:GROUP FILE…

For example I want to change owner and group of file /var/www/html/index.php from root to apache.

chown apache:apache /var/www/html/index.php

You need to have root privilege to do that.

Sometimes you want to change the entire directory including its sub dir and files, you can specified -R (Recursive) option.

For example, I want to change owner and group of directory /var/www/html/blog from root to apache.

chown -R apache:apache /var/www/html/blog

2 Responses to “change owner of the file”

  1. Nice post, are you seling links from your website? I’m interested…

  2. Thanks a whole lot for offering people who have such a marvellous possible opportunity to examine ideas out of this blog. It’s generally extremely best as well as filled with a great time personally as well as my own office partners to visit your web site specifically 3 x each week to review the new items you possess. Not only that, we have been undoubtedly satisfied regarding the great information you give. Picked a couple of tips on this site are really the best That i’ve ever acquired.

Leave a Reply