1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-02 11:17:59 +01:00
tldr/pages/common/chown.md

24 lines
532 B
Markdown
Raw Normal View History

2013-12-25 13:59:24 +01:00
# chown
> Change the owning user/group of the specified files.
2013-12-25 13:59:24 +01:00
- Change the user of a file:
2013-12-25 13:59:24 +01:00
`chown {{user}} {{path/to/file}}`
- Change the user and group of a file:
2015-10-22 09:31:52 +02:00
2013-12-25 13:59:24 +01:00
`chown {{user}}:{{group}} {{path/to/file}}`
- Recursively change the owner of an entire folder:
2013-12-25 13:59:24 +01:00
`chown -R {{user}} {{path/to/folder}}`
- Change the owner of a symbolic link:
2015-10-22 09:31:52 +02:00
2013-12-25 13:59:24 +01:00
`chown -h {{user}} {{path/to/symlink}}`
- Use the owner and group of a reference file and apply those values to another file:
`chown --reference={{reference-file}} {{path/to/file}}`