2019-12-22 05:47:55 +00:00
|
|
|
.Dd 2019-12-21
|
2015-01-31 13:20:02 +00:00
|
|
|
.Dt CHMOD 1
|
2015-01-31 19:37:03 +00:00
|
|
|
.Os sbase
|
2015-01-17 21:33:19 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm chmod
|
2015-03-05 18:08:28 +00:00
|
|
|
.Nd change file modes
|
2015-01-17 21:33:19 +00:00
|
|
|
.Sh SYNOPSIS
|
2015-01-30 20:17:58 +00:00
|
|
|
.Nm
|
2019-12-22 05:47:55 +00:00
|
|
|
.Op Fl R
|
2015-01-17 21:33:19 +00:00
|
|
|
.Ar mode
|
2015-02-16 16:47:07 +00:00
|
|
|
.Ar file ...
|
2015-01-17 21:33:19 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
2015-03-05 18:08:28 +00:00
|
|
|
changes the file mode of each
|
|
|
|
.Ar file
|
|
|
|
to
|
|
|
|
.Ar mode .
|
2015-01-17 21:33:19 +00: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 21:08:38 +00:00
|
|
|
"[ugoa]*[+-=][rwxXst]*"
|
2015-01-17 21:33:19 +00: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 21:08:38 +00:00
|
|
|
.It X
|
|
|
|
execute, if directory or at least one execute bit is already set
|
2015-01-17 21:33:19 +00:00
|
|
|
.El
|
2019-12-22 05:47:55 +00:00
|
|
|
.Pp
|
|
|
|
Symbolic links are followed if they are passed as operands, and ignored
|
|
|
|
if they are encountered during directory traversal.
|
2015-01-17 21:33:19 +00:00
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl R
|
2015-02-16 16:47:07 +00:00
|
|
|
Change modes recursively.
|
2015-01-17 21:33:19 +00:00
|
|
|
.El
|
2015-01-28 20:15:55 +00:00
|
|
|
.Sh SEE ALSO
|
2015-02-16 16:47:07 +00:00
|
|
|
.Xr chgrp 1 ,
|
2015-01-28 20:15:55 +00:00
|
|
|
.Xr umask 1
|
2015-01-17 21:33:19 +00:00
|
|
|
.Sh STANDARDS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility is compliant with the
|
2015-03-27 16:22:48 +00:00
|
|
|
.St -p1003.1-2013
|
2015-01-17 21:33:19 +00:00
|
|
|
specification.
|
|
|
|
.Pp
|
|
|
|
The
|
2015-02-16 16:47:07 +00:00
|
|
|
.Op Fl HLP
|
|
|
|
flags are an extension to that specification.
|