Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In this above command what is sudo,chown,-R,www-data? In which place we are using this command,why two times www-data reapeted. Please explain me.

share

locked by Chris S Oct 29 '12 at 14:11

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

7  
You are using this command without knowing why/what it does? Is this a real job? –  pauska Nov 11 '10 at 7:05

3 Answers 3

The first thing I'll try to explain is sudo. sudo stands for superuser do. Using sudo, the user can act as a 'root' level of system operation. Shortly, sudo gives user a privilege as a root system.

And then, about chown, chown is used for setting the ownership of folder or file. The explanation of -R had been answered (it recursively descends to all sub-folders).

So the last thing is about www-data written repeated.www-data:www-data the first one is user, the second is group. Your username can be added as a member of www-data group, by this command sudo adduser user www-data, user can be replaced with your username. That command will result in user www-data.

Hope it helps..

share

The syntax for chown is user:group - so this command changes the ownder of all files to www-data, and the group to www-data.

share

It's recursively changing both the user and group owners for the file path specified.

share

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