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.
Written by Carlos Fernandez
Related protips
3 Responses
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#