Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

this is my ls -all, the zfapi folder have the root right , how can i change this to www-data. Also Please advise what is the first root and secont root is ? Thanks

drwxr-xr-x  4 www-data www-data  4096 2011-01-06 18:21 cdnapi
-rw-r--r--  1 www-data www-data   678 2010-08-30 12:02 config.js
drwxr-xr-x  4 www-data www-data  4096 2010-11-23 15:55 css
drwxr-xr-x  7 www-data www-data  4096 2010-11-17 13:12 images
-rw-r--r--  1 www-data www-data 25064 2010-12-17 18:26 index.html
-rw-r--r--  1 www-data www-data 19830 2010-12-18 11:24 init.js
drwxr-xr-x  2 www-data www-data  4096 2010-12-02 12:34 lib
-rw-r--r--  1 www-data www-data 18758 2010-12-06 18:00 styles.css
-rw-r--r--  1 www-data www-data  1081 2010-10-21 17:56 testbganim.html
drwxr-xr-x  2 www-data www-data  4096 2010-12-17 11:15 yapi
drwxr-xr-x  7 root     root      4096 2011-01-07 18:20 zfapi
share|improve this question

migrated from Jan 8 '11 at 7:14

This question came from our site for professional and enthusiast programmers.

To change the ownership,

sudo chown -R www-data:www-data zfapi

The first column is the user that owns the folder. The second column is the group that owns the folder. "sudo" causes you to execute a command with root privileges, so be careful! chown -R recursively changes the ownership of the target directory to the specified user:group. For details,

man chown
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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