Last Updated: February 25, 2016
·
496
· fernandez14

Change owner of a whole directory

Using console to change directory's owner

Well, sometimes it could happen when you work with a http server that the files must belong to www-data or any other user, but when you are coding on the fly the documents are saved by other user, that means you have to change the whole directory's owner before you deploy your application.

The code you must follow is next:

chown -R www-data ./

Where www-data is the new directory's owner, and ./ is the path to it.

Hopefully you find this helpful.

3 Responses
Add your response

Probably best to prefix it with sudo ;-)

over 1 year ago ·

I forgot, u r right, I always use the console as root that's why :)

over 1 year ago ·

Same syntax with chmod.

over 1 year ago ·