chown
chown [OPCIÓN]... [PROPIETARIO][:[GRUPO]] ARCHIVO...
chown [OPCIÓN]... --reference=RARCHIVO ARCHIVO...
Cambiar propietario y grupo de archivo
Options
--help-
Print help information.
--changes,-c-
like verbose but report only when a change is made
--from=<CURRENT_OWNER:CURRENT_GROUP>-
change the owner and/or group of each file only if its
current owner and/or group match those specified here.
Either may be omitted, in which case a match is not required
for the omitted attribute --preserve-root-
fail to operate recursively on ‘/’
--no-preserve-root-
do not treat ‘/’ specially (the default)
--quiet-
suppress most error messages
--recursive,-R-
operate on files and directories recursively
--reference=<RFILE>-
use RFILE’s owner and group rather than specifying OWNER:GROUP values
--silent,-f--verbose,-v-
output a diagnostic for every file processed
-H-
if a command line argument is a symbolic link to a directory, traverse it
-L-
traverse every symbolic link to a directory encountered
-P-
do not traverse any symbolic links (default)
--dereference-
affect the referent of each symbolic link (this is the default), rather than the symbolic link itself
--no-dereference,-h-
affect symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink)
Examples
Cambia el usuario propietario de un archivo/directorio:
chown {{usuario}} {{ruta/al/archivo_o_directorio}}
Cambia el usuario y grupo propietario de un archivo/directorio:
chown {{usuario}}:{{grupo}} {{ruta/al/archivo_o_directorio}}
Cambia el usuario propietario y el grupo para que ambos sean usuario:
chown {{usuario}}: {{ruta/al/archivo_o_directorio}}
Cambia recursivamente el propietario de un directorio y su contenido:
chown {{[-R|--recursive]}} {{usuario}} {{ruta/al/directorio}}
Cambia el propietario de un enlace simbólico:
chown {{[-h|--no-dereference]}} {{usuario}} {{ruta/al/enlace_simbólico}}
Cambia el propietario de un archivo/directorio para que coincida con un archivo de referencia:
chown --reference {{ruta/al/archivo_de_referencia}} {{ruta/al/archivo_o_directorio}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.