2019-12-22 00:47:55 -05:00
|
|
|
.Dd 2019-12-21
|
2015-01-31 08:20:02 -05:00
|
|
|
.Dt CHMOD 1
|
2015-01-31 14:37:03 -05:00
|
|
|
.Os sbase
|
2015-01-17 16:33:19 -05:00
|
|
|
.Sh NAME
|
|
|
|
.Nm chmod
|
2015-03-05 13:08:28 -05:00
|
|
|
.Nd change file modes
|
2015-01-17 16:33:19 -05:00
|
|
|
.Sh SYNOPSIS
|
2015-01-30 15:17:58 -05:00
|
|
|
.Nm
|
2019-12-22 00:47:55 -05:00
|
|
|
.Op Fl R
|
2015-01-17 16:33:19 -05:00
|
|
|
.Ar mode
|
2015-02-16 11:47:07 -05:00
|
|
|
.Ar file ...
|
2015-01-17 16:33:19 -05:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
2015-03-05 13:08:28 -05:00
|
|
|
changes the file mode of each
|
|
|
|
.Ar file
|
|
|
|
to
|
|
|
|
.Ar mode .
|
2015-01-17 16:33:19 -05:00
|
|
|
.Pp
|
|
|
|
If
|
|
|
|
.Ar mode
|
|
|
|
is
|
|
|
|
.Em octal
|
|
|
|
"[sog]e"
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It s
|
|
|
|
.Xr sticky 1 => s += 1
|
|
|
|
.Pp
|
|
|
|
.Xr setgid 2 => s += 2
|
|
|
|
.Pp
|
|
|
|
.Xr setuid 4 => s += 4
|
|
|
|
.It o|g|e
|
|
|
|
owner | group | everyone
|
|
|
|
.Pp
|
|
|
|
.Xr execute 1 => o|g|e += 1
|
|
|
|
.Pp
|
|
|
|
.Xr write 2 => o|g|e += 2
|
|
|
|
.Pp
|
|
|
|
.Xr read 4 => o|g|e += 4
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Leading zeroes may be omitted.
|
|
|
|
.Pp
|
|
|
|
If
|
|
|
|
.Ar mode
|
|
|
|
is
|
|
|
|
.Em symbolic
|
2020-01-06 16:08:38 -05:00
|
|
|
"[ugoa]*[+-=][rwxXst]*"
|
2015-01-17 16:33:19 -05:00
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It u|g|o|a
|
|
|
|
owner | group | other (non-group) | everyone
|
|
|
|
.It +|-|=
|
|
|
|
add | remove | set
|
|
|
|
.It r|w|x|s|t
|
|
|
|
read | write | execute | setuid and setgid | sticky
|
2020-01-06 16:08:38 -05:00
|
|
|
.It X
|
|
|
|
execute, if directory or at least one execute bit is already set
|
2015-01-17 16:33:19 -05:00
|
|
|
.El
|
2019-12-22 00:47:55 -05:00
|
|
|
.Pp
|
|
|
|
Symbolic links are followed if they are passed as operands, and ignored
|
|
|
|
if they are encountered during directory traversal.
|
2015-01-17 16:33:19 -05:00
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl R
|
2015-02-16 11:47:07 -05:00
|
|
|
Change modes recursively.
|
2015-01-17 16:33:19 -05:00
|
|
|
.El
|
2015-01-28 15:15:55 -05:00
|
|
|
.Sh SEE ALSO
|
2015-02-16 11:47:07 -05:00
|
|
|
.Xr chgrp 1 ,
|
2015-01-28 15:15:55 -05:00
|
|
|
.Xr umask 1
|
2015-01-17 16:33:19 -05:00
|
|
|
.Sh STANDARDS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility is compliant with the
|
2015-03-27 12:22:48 -04:00
|
|
|
.St -p1003.1-2013
|
2015-01-17 16:33:19 -05:00
|
|
|
specification.
|
|
|
|
.Pp
|
|
|
|
The
|
2015-02-16 11:47:07 -05:00
|
|
|
.Op Fl HLP
|
|
|
|
flags are an extension to that specification.
|