mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-12-26 18:32:41 +03:00
24 lines
553 B
Markdown
24 lines
553 B
Markdown
# chown
|
|
|
|
> Change user and group ownership of files and folders.
|
|
|
|
- Change the owner user of a file/folder:
|
|
|
|
`chown {{user}} {{path/to/file}}`
|
|
|
|
- Change the owner user and group of a file/folder:
|
|
|
|
`chown {{user}}:{{group}} {{path/to/file}}`
|
|
|
|
- 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/folder to match a reference file:
|
|
|
|
`chown --reference={{path/to/reference_file}} {{path/to/file}}`
|