Question

I need to change the owner and group of a file or directory in Unix. How do I do this?

I need to change the owner and group of a file or directory in Unix. How do I do this?

Answer:

You can change the owner and group of a file or directory using a <changeOwnerAndGroup> action. Because these changes require administrative privileges, you will need to require installation by the administrator. You will have to include a section like the one below inside an action list section of your XML installer project file.


<changeOwnerAndGroup>
    <files>*/somefile.conf;*/var/somefile</files>
    <owner>nobody</owner>
    <group>nobody</group>
</changeOwnerAndGroup>