Terminal Dojo
Help العربية Sign inGet started

Command library / chown

chown

BashDraft — pending expert review4 practice missions

Change file owner and group

Changes WHO owns a file — as opposed to chmod, which changes what the owner is allowed to do. The form is owner:group, either half optional: 'deploy' changes just the owner, ':www-data' changes just the group, 'deploy:www-data' changes both at once.

Practice chown

Usage

chown [options] owner[:group] file...

Options and flags

Examples

Common mistakes

chown deploy www-data /var/www/app chown deploy:www-data /var/www/app

Owner and group are joined by a colon into ONE argument — a space between them makes chown think 'www-data' is a second file to change, not the group.

Related commands

chmodls