Files
tldr/pages/common/chown.md
Marco Bonelli f79f6011e0 Refactor: add missing or_directory where needed.
This commit adds the missing `_or_directory` to any example which is
specifying an action affecting a file or a directory, but uses the
token `{{path/to/file}}` instead of `{{path/to/file_or_directory}}`.
2019-02-08 19:43:24 +00:00

601 B

chown

Change user and group ownership of files and folders.

  • Change the owner user of a file/directory:

chown {{user}} {{path/to/file_or_directory}}

  • Change the owner user and group of a file/directory:

chown {{user}}:{{group}} {{path/to/file_or_directory}}

  • Recursively change the owner of a folder and its contents:

chown -R {{user}} {{path/to/folder}}

  • Change the owner of a symbolic link:

chown -h {{user}} {{path/to/symlink}}

  • Change the owner of a file/directory to match a reference file:

chown --reference={{path/to/reference_file}} {{path/to/file_or_directory}}