2013-12-25 13:59:24 +01:00
|
|
|
# chown
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
> Change the owning user/group of the specified files.
|
2013-12-25 13:59:24 +01:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Change the user of a file:
|
2013-12-25 13:59:24 +01:00
|
|
|
|
|
|
|
`chown {{user}} {{path/to/file}}`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- 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}}`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Recursively change the owner of an entire folder:
|
2013-12-25 13:59:24 +01:00
|
|
|
|
|
|
|
`chown -R {{user}} {{path/to/folder}}`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- 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}}`
|
2014-08-18 12:45:43 +02:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Use the owner and group of a reference file and apply those values to another file:
|
2014-08-18 12:45:43 +02:00
|
|
|
|
|
|
|
`chown --reference={{reference-file}} {{path/to/file}}`
|