⌘K
Options (2)
-R, --recursivebooleanRecursively change the owner of a directory and its contents
Example:
sudo chown {{[-R|--recursive]}} {{user}} {{path/to/directory}}-h, --no-dereferencebooleanChange the owner of a symbolic link
Example:
sudo chown {{[-h|--no-dereference]}} {{user}} {{path/to/symlink}}Examples (7)
Change the owner user of a file/directory
sudo chown user path/to/file_or_directoryChange the owner user and group of a file/directory
sudo chown user:group path/to/file_or_directoryChange the owner user and group to both have the name `user`
sudo chown user: path/to/file_or_directoryChange the group of a file to a group that the current user belongs to
chown :group path/to/file_or_directoryRecursively change the owner of a directory and its contents
sudo chown [-R|--recursive] user path/to/directoryChange the owner of a symbolic link
sudo chown [-h|--no-dereference] user path/to/symlinkChange the owner of a file/directory to match a reference file
sudo chown --reference path/to/reference_file path/to/file_or_directorymade by @shridhargupta | data from tldr-pages