1

I am pretty new in Linux and I have a doubt related to the use of the chown command use.

If I have something like this:

chown -R root:root /usr/share/MyApplicationDirectory

What exactly mean?

I think that I am changing the owner of all directory and files content into MyApplicationDirectory assigning them to the root user

But why it specify: root:root and not only root?

Reading the documenation I have found that the syntax is

chown [optuion] [--] user[:group] file1 [file2 …]

So I think that the :root is the group. But why? exist a :root group also a root user?

3

Simply you can change "group" or not.

chown -R root:root /usr/share/MyApplicationDirectory

means only user root or someone in group root (most Linux systems, including Ubuntu, have a root group).

chown -R root /usr/share/MyApplicationDirectory

in this case group is unchanged.

4

Yes. The user:group syntax is optional. And the -R means recursive. The reason there is a root group and a root user, is you may not always want to use the root acccount, but rather, an "admin" account, and it but still be a member of the root group, able to perform superuser actions (Most config files are owned by root but have group write permissions). Likewise, a salesman called "bob" may want to chown some sales presentations to bob:sales, so his colleagues can access them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.