chown
FilesPackage: coreutilsHandle with care
Changes a file's owner and group. A service that "cannot write" to its own directory has almost always a missing chown after a copy made by root.
A mistake with this command can destroy data or lock you out
- A
chown -Ron/,/etcor/usrbreaks the machine:sudorefuses to work the moment/etc/sudoersis no longer root's. Check the target withls -ldfirst, and beware an empty variable in the path.
What its options do in the lessons
From the same glossary the lessons render under their commands, so the two cannot disagree.
chown -R- Applies recursively to subdirectories.
chown --reference- Takes the owner and the group from another file instead of an OWNER:GROUP argument. The counterpart to
chmod --reference: a temporary file created by root picks up the account that owned the target.
