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
link|improve this question

50% accept rate
@Rahul Server Administration questions ought to be asked over at serverfault.com and power user questions ought to be asked over at superuser.com. Stack Overflow is for programming questions. I'm sorry for any confusion. – Jonathan Sampson Jan 8 '11 at 7:06
@Jonathan Sorry Forget to post over there,because rarely work on server :) , next time want to take care :) – Rahul Mehta Jan 8 '11 at 7:10
@Raul It's alright. Which site should this be migrated to? It's difficult for me to tell whether you're dealing with a server issue, or just playing with a local distro of ubuntu. – Jonathan Sampson Jan 8 '11 at 7:12
@Jonathan migrate it to serverfault ,dealing with server – Rahul Mehta Jan 8 '11 at 7:13
feedback

migrated from stackoverflow.com Jan 8 '11 at 7:14

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

2 Answers

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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