2015-10-08 11:15:08 -04:00
|
|
|
.Dd 2015-10-08
|
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
|
2015-02-16 11:47:07 -05:00
|
|
|
.Oo
|
|
|
|
.Fl R
|
|
|
|
.Op Fl H | L | P
|
|
|
|
.Oc
|
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
|
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl R
|
2015-02-16 11:47:07 -05:00
|
|
|
Change modes recursively.
|
|
|
|
.It Fl H
|
2015-03-05 13:08:28 -05:00
|
|
|
Dereference
|
|
|
|
.Ar file
|
|
|
|
if it is a symbolic link.
|
2015-02-16 11:47:07 -05:00
|
|
|
.It Fl L
|
2015-03-05 13:08:28 -05:00
|
|
|
Dereference all symbolic links.
|
2015-02-16 11:47:07 -05:00
|
|
|
.It Fl P
|
2015-03-05 13:08:28 -05:00
|
|
|
Preserve symbolic links. This is the default.
|
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.
|