.ie \n(.g .ds Aq \(aq .el .ds Aq ' .TH CHCON 1 "2026-10-29" .SH NAME chcon \- Change the SELinux security context of each FILE to CONTEXT. With \-\-reference, change the security context of each FILE to that of RFILE. .SH SYNOPSIS \fBchcon\fR [OPTION]... CONTEXT FILE... .br \fBchcon\fR [OPTION]... [\-u USER] [\-r ROLE] [\-l RANGE] [\-t TYPE] FILE... .br \fBchcon\fR [OPTION]... \-\-reference=RFILE FILE... .SH DESCRIPTION Change the SELinux security context of each FILE to CONTEXT. With \-\-reference, change the security context of each FILE to that of RFILE. .SH OPTIONS .TP \fB\-\-dereference\fR Affect the referent of each symbolic link (this is the default), rather than the symbolic link itself. .TP \fB\-h\fR, \fB\-\-no\-dereference\fR Affect symbolic links instead of any referenced file. .TP \fB\-\-help\fR help .TP \fB\-\-preserve\-root\fR Fail to operate recursively on \*(Aq/\*(Aq. .TP \fB\-\-no\-preserve\-root\fR Do not treat \*(Aq/\*(Aq specially (the default). .TP \fB\-\-reference\fR \fI\fR Use security context of RFILE, rather than specifying a CONTEXT value. .TP \fB\-u\fR, \fB\-\-user\fR \fI\fR Set user USER in the target security context. .TP \fB\-r\fR, \fB\-\-role\fR \fI\fR Set role ROLE in the target security context. .TP \fB\-t\fR, \fB\-\-type\fR \fI\fR Set type TYPE in the target security context. .TP \fB\-l\fR, \fB\-\-range\fR \fI\fR Set range RANGE in the target security context. .TP \fB\-R\fR, \fB\-\-recursive\fR Operate on files and directories recursively. .TP \fB\-H\fR If a command line argument is a symbolic link to a directory, traverse it. Only valid when \-R is specified. .TP \fB\-L\fR Traverse every symbolic link to a directory encountered. Only valid when \-R is specified. .TP \fB\-P\fR Do not traverse any symbolic links (default). Only valid when \-R is specified. .TP \fB\-v\fR, \fB\-\-verbose\fR Output a diagnostic for every file processed. .TP \fB\-V\fR, \fB\-\-version\fR Print version .TP [\fIFILE\fR] .SH VERSION v(uutils coreutils) 0.12.0