What does the second www-data mean?

I don't know much about chown.

chown rob:developers strace.log

      

Change strace.log owner to "rob" and group ID to "developers".

how about the command:

chown  www-data.www-data /var/www/html/

      

1.it is www-data.www-data, not www-data: www-data, what does it mean .

here?
2. I know the first www-data is the group name, how about the second www-data?

On my system: debian7.

cat   /etc/group
www-data:x:33:

cat  /etc/passwd
www-data:x:33:33:www-data:/var/www:/bin/sh

      

The command chown -Rf www-data.www-data /var/www/html/

works fine in my debian.

+3


source to share


3 answers


chmown owner_name.group_name file/directory

      

chown (1) - Linux personal page

How to use chmod and chown command



Complete list of chown command:

chown owner-user file
chown owner-user:owner-group file
chown owner-user:owner-group directory
chown options owner-user:owner-group file

      

+1


source


It has a similar meaning, so the dot (.) Was an older way of separating owner and group by this



Previous versions of the chown utility used the dot (``.'') character to distinguish the group name.

This has been changed to be a colon (``:'') character, so that user and group names may contain the dot character.

      

+2


source


In the old version, chown '.' and ':' were used to separate username and group. But currently some versions of chown still allow "." for backward compatibility. Now ':' is the preferred way.

The chown command works like this:

chown [-fhv] [-R [-H | -L | -P]] owner[:group] file

chown [-fhv] [-R [-H | -L | -P]] :group file

      

In chown

you must specify the owner, but the group is optional. And the group can be specified with: "after owner".

So, technically, chown www-data.www-data /var/www/html/

should fail with later versions of chown.

0


source







All Articles