chown

Change the owner and group of a file

chown changes ownership. chown ubuntu:www-data file sets owner to ubuntu and group to www-data. Use after copying files as root; they'll be owned by root and the app can't write to them.

Example

$ chown ubuntu:ubuntu /var/log/app.log
-rw-r--r-- 1 ubuntu ubuntu 4096 Jan 15 /var/log/app.log
Tip: Type it yourself in the terminal below - reading is not the same as doing.