Skip to content

chown command

Change the owner and group of files.

On this page

Syntax

chown [options] user[:group] file…

Provided by the coreutils package. Run man chown for the full manual.

Common options

OptionWhat it does
-RApply recursively
-vPrint each change
-hChange a symlink itself, not its target
--reference=FILECopy the owner of FILE

Examples

  1. Change the owner

    sudo chown alice report.pdf
  2. Change owner and group

    sudo chown www-data:www-data /var/www/html/index.php
  3. Change recursively

    sudo chown -R www-data:www-data /var/www/html
  4. Change only the group

    sudo chown :developers project/
  5. Copy ownership from another file

    sudo chown --reference=a.txt b.txt

chown guides

← All Linux commands · Suggest a fix

Back to top