make consistent with POSIX 1003.2, draft 10. Now have two recursive
[unix-history] / usr / src / bin / cp / cp.1
index fa98865..afb838b 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"     @(#)cp.1       6.9 (Berkeley) %G%
+.\"     @(#)cp.1       6.10 (Berkeley) %G%
 .\"
 .Dd 
 .Dt CP 1
 .\"
 .Dd 
 .Dt CP 1
@@ -17,7 +17,7 @@
 .Ar source_file target_file
 .br
 .Nm cp
 .Ar source_file target_file
 .br
 .Nm cp
-.Op Fl fhipr
+.Op Fl Rfhip
 .Ar source_file ... target_directory
 .Sh DESCRIPTION
 In the first synopsis form,
 .Ar source_file ... target_directory
 .Sh DESCRIPTION
 In the first synopsis form,
@@ -41,23 +41,29 @@ Forces
 .Nm cp
 to follow symbolic links.
 Provided for the
 .Nm cp
 to follow symbolic links.
 Provided for the
-.Fl r
+.Fl R
 option which does not follow symbolic links by default.
 .Tp Fl f
 option which does not follow symbolic links by default.
 .Tp Fl f
-Force existing destination pathnames to be truncated before copying,
-without prompting for confirmation.
-(The
+Turns off the
 .Fl i
 .Fl i
-option is ignored if the
+option.
+(The last
 .Fl f
 .Fl f
-option is specified.)
+or
+.Fl i
+option overrides any previous specification of either option.)
 .Tp Fl i
 Causes
 .Nm cp
 to write a prompt to standard error before copying a file that would
 overwrite an existing file.
 If the response from the standard input begins with the character ``y'',
 .Tp Fl i
 Causes
 .Nm cp
 to write a prompt to standard error before copying a file that would
 overwrite an existing file.
 If the response from the standard input begins with the character ``y'',
-the file is copied if permissions allow the copy.
+the file is copied if permissions allow.
+(The last
+.Fl f
+or
+.Fl i
+option overrides any previous specification of either option.)
 .Tp Fl p
 Causes
 .Nm cp
 .Tp Fl p
 Causes
 .Nm cp
@@ -68,51 +74,46 @@ file mode, user ID, and group ID as allowed by permissions.
 If the user ID and group ID cannot be preserved, no error message
 is displayed and the exit value is not altered.
 .Pp
 If the user ID and group ID cannot be preserved, no error message
 is displayed and the exit value is not altered.
 .Pp
-If the source file has its set user ID bit on and the user ID cannot
-be preserved, the set user ID bit is not preserved
-in the copy's permissions.
-If the source file has its set group ID bit on and the group ID cannot
-be preserved, the set group ID bit is not preserved
-in the copy's permissions.
-If the source file has both the set user ID and set group ID bits
-on and either the user ID or group ID cannot be preserved, neither
-the set user ID or set group ID bits are preserved in the copy's
-permissions.
-.Tp Fl r
+If the source file is set user ID or set group ID, and either the user
+ID or the group ID cannot be preserved, the set user ID and set group
+ID bits are not preserved in the copy's permissions.
+.Tp Fl R
 If
 .Ar source_file
 designates a directory,
 .Nm cp
 copies the directory and the entire subtree connected at that point.
 If
 .Ar source_file
 designates a directory,
 .Nm cp
 copies the directory and the entire subtree connected at that point.
-This option also causes symbolic links to be copied, rather than
-indirected through, and for
-.Nm cp
-to create special files rather than copying them as normal files.
+Special file types, such as symbolic links and block and character
+devices, are recreated instead of being copied.
 Created directories have the same mode as the corresponding source
 Created directories have the same mode as the corresponding source
-directory, unmodified by the process' umask.
+directory, unmodified by the process' file mode creation mask (umask).
+.Tp Fl r
+The
+.Fl r
+option is identical to the
+.Fl R
+option with the exception that it does not treat special files
+differently from regular files.
+Symbolic links are always followed.
+This option has been deprecated.
 .Tp
 .Pp
 For each destination file that already exists, its contents are
 .Tp
 .Pp
 For each destination file that already exists, its contents are
-overwritten if permissions allow, but its mode, user ID, and group
-ID are unchanged.
+overwritten if permissions allow, but
+.Nm cp
+will not change its mode, user ID, or group ID.
+However, if the file is not being copied by the super-user,
+writing the file may clear the set user ID or set group ID
+permission bits.
 .Pp
 If the destination file does not exist, the mode of the source file is
 used as modified by the file mode creation mask (umask).
 .Pp
 If the destination file does not exist, the mode of the source file is
 used as modified by the file mode creation mask (umask).
-If the source file has its set user ID bit on, that bit is removed
-unless both the source file and the destination file are owned by the
-same user.
-If the source file has its set group ID bit on, that bit is removed
-unless both the source file and the destination file are in the same
-group and the user is a member of that group.
-If both the set user ID and set group ID bits are set, all of the above
-conditions must be fulfilled or both bits are removed.
+If the source file is either set user ID or set group ID, those
+bits are removed unless the source file and the destination
+file are owned by the same user and group.
 .Pp
 Appropriate permissions are required for file creation or overwriting.
 .Pp
 .Pp
 Appropriate permissions are required for file creation or overwriting.
 .Pp
-Symbolic links are followed unless the
-.Fl r
-option is specified, in which case the link itself is copied.
-.Pp
 .Nm Cp
 exits 0 on success, >0 if an error occurred.
 .Sh SEE ALSO
 .Nm Cp
 exits 0 on success, >0 if an error occurred.
 .Sh SEE ALSO