Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does the second www-data mean?

Tags:

shell

I know little about chown.

chown rob:developers strace.log

Change the owner of strace.log to 'rob' and the group identifier 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 . mean here?
2.I know the first www-data is the group name, how about the second www-data mean here?

In 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.

like image 955
showkey Avatar asked Sep 17 '25 18:09

showkey


2 Answers

It has similar meaning just that dot(.) was an older way of separating owner and group as per 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.
like image 159
SMA Avatar answered Sep 21 '25 10:09

SMA


chmown owner_name.group_name file/directory

chown(1) - Linux man page

How To Use chmod and chown Command

Full 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
like image 30
sandipon Avatar answered Sep 21 '25 10:09

sandipon