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.

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.

Read more about locked posts here.

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

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


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.


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

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