BSD 4_3 release
[unix-history] / usr / man / man1 / chmod.1
index 6b79ec8..859833c 100644 (file)
@@ -1,8 +1,13 @@
-.TH CHMOD 1 "18 January 1983"
+.\"    @(#)chmod.1     6.3 (Berkeley) 5/22/86
+.\"
+.TH CHMOD 1 "May 22, 1986"
+.AT 3
 .SH NAME
 chmod \- change mode
 .SH SYNOPSIS
 .SH NAME
 chmod \- change mode
 .SH SYNOPSIS
-\fBchmod\fP mode file ...
+\fBchmod\fP [
+.B \-Rf
+] mode file ...
 .SH DESCRIPTION
 The mode of each named file is changed according to \fImode\fP,
 which may be absolute or symbolic.  An absolute \fImode\fP
 .SH DESCRIPTION
 The mode of each named file is changed according to \fImode\fP,
 which may be absolute or symbolic.  An absolute \fImode\fP
@@ -64,20 +69,39 @@ but the setting of the file creation mask (see umask(2)) is taken into account.
 \fIpermission\fP absolutely (all other bits will be reset).
 .LP
 \fIPermission\fP is any combination of the letters \fBr\fP (read),
 \fIpermission\fP absolutely (all other bits will be reset).
 .LP
 \fIPermission\fP is any combination of the letters \fBr\fP (read),
-\fBw\fP (write), \fBx\fP (execute), \fBs\fP (set owner or group id)
-and \fBt\fP (save text \- sticky).  Letters
-.BR u,
-\fBg\fP or \fBo\fP indicate that \fIpermission\fP
-is to be taken from the current mode.  Omitting \fIpermission\fP
+\fBw\fP (write), \fBx\fP (execute),
+\fBX\fP (set execute only if file is a directory
+or some other execute bit is set),
+\fBs\fP (set owner or group id)
+and \fBt\fP (save text \- sticky).
+Letters \fBu\fP, \fBg\fP, or \fBo\fP indicate that \fIpermission\fP
+is to be taken from the current mode. 
+Omitting \fIpermission\fP
 is only useful with \fB=\fP to take away all permissions.
 is only useful with \fB=\fP to take away all permissions.
+.PP
+When the
+.B \-R
+option is given, 
+.I chmod
+recursively descends its directory arguments
+setting the mode for each file as described above.
+When symbolic links are encountered, their mode is not changed
+and they are not traversed.
+.PP
+If the
+.B \-f
+option is given,
+.I chmod
+will not complain if it fails to change the mode
+on a file.
 .SH EXAMPLES
 .LP
 The first example denies write permission to others,
 .SH EXAMPLES
 .LP
 The first example denies write permission to others,
-the second makes a file executable:
+the second makes a file executable by all if it is executable by anyone:
 .IP
 chmod o\-w file
 .br
 .IP
 chmod o\-w file
 .br
-chmod +x file
+chmod +X file
 .LP
 Multiple symbolic modes separated by commas may be given.
 Operations are performed in the order specified.  The letter
 .LP
 Multiple symbolic modes separated by commas may be given.
 Operations are performed in the order specified.  The letter
@@ -86,18 +110,3 @@ Operations are performed in the order specified.  The letter
 Only the owner of a file (or the super-user) may change its mode.
 .SH "SEE ALSO"
 ls(1), chmod(2), stat(2), umask(2), chown(8)
 Only the owner of a file (or the super-user) may change its mode.
 .SH "SEE ALSO"
 ls(1), chmod(2), stat(2), umask(2), chown(8)
-.SH MESSAGES
-.LP
-.IP "Usage: chmod [ugoa][+-=][rwxstugo] file ..." 10
-.br
-Standard memory jogger message indicating how to use the \fIchmod\fP command.
-.IP "chmod: can't access \fIfilename\fP" 10
-.br
-The file or directory specified by \fIfilename\fP does not exist.
-.IP "chmod: can't change \fIfilename\fP" 10
-.br
-You are trying to change permissions on a file or directory which you don't own.
-.IP "chmod: invalid mode" 10
-.br
-The file mode specified on the command line is incorrect.  This often
-happens when you type the filename first and the mode second.