1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-10-31 06:18:17 +01:00
tldr/pages/common/chown.md
Marco Bonelli 2599a6de48 Refactor: change "folder" to "directory" where needed.
This commit fixes every instance in which the word "folder" is
incorrectly used instead of "directory".
2019-02-13 20:51:04 +05:30

611 B

chown

Change user and group ownership of files and directories.

  • 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 directory and its contents:

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

  • 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}}