home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / W2KPRK.iso / apps / posix / source / MAN / CP.PRT < prev    next >
Text File  |  1999-11-17  |  4KB  |  133 lines

  1.                                                            CP (1)
  2.  
  3. NAME
  4.  
  5.   cp - copy files
  6.  
  7. SYNOPSIS
  8.  
  9.   cp [ Rfhip ] source_file target_file cp [ Rfhip  ]  source_file
  10. ... target_directory
  11. DESCRIPTION
  12.  
  13.   In the first synopsis form, the cp utility copies the  contents
  14. of  the  source_file  to the target_file . In the second synopsis
  15. form, the contents of each named source_file  is  copied  to  the
  16. destination  target_directory . The names of the files themselves
  17. are not changed.  If cp detects an attempt to copy a file to  it-
  18. self, the copy will fail.
  19.   The following options are available:
  20.      R - If source_file designates a  directory,  cp  copies  the
  21.      directory  and  the  entire subtree connected at that point.
  22.      This option also causes symbolic links to be copied,  rather
  23.      than  indirected through, and for cp to create special files
  24.      rather than copying them as normal  files.   Created  direc-
  25.      tories have the same mode as the corresponding source direc-
  26.      tory, unmodified by the process' umask.
  27.      f - For each existing destination pathname,  remove  it  and
  28.      create  a  new  file, without prompting for confirmation re-
  29.      gardless of its permissions.  (The option is ignored if  the
  30.      option is specified.)
  31.      h - Forces cp to follow symbolic links.   Provided  for  the
  32.      option which does not follow symbolic links by default.
  33.      i - Causes cp to write a prompt  to  standard  error  before
  34.      copying  a  file  that would overwrite an existing file.  If
  35.      the response from the standard input begins with the charac-
  36.      ter the file is copied if permissions allow the copy.
  37.      p - Causes cp to preserve in the copy as many of the modifi-
  38.      cation  time,  access time, file mode, user ID, and group ID
  39.      as allowed by permissions.
  40.        If the user ID and group ID cannot be preserved, no  error
  41.      message is displayed and the exit value is not altered.
  42.        If the source file has its set user ID bit on and the user
  43.      ID cannot be preserved, the set user ID bit is not preserved
  44.      in the copy's permissions.  If the source file has  its  set
  45.      group  ID  bit  on and the group ID cannot be preserved, the
  46.      set group ID bit is not preserved in the copy's permissions.
  47.      If the source file has both the set user ID and set group ID
  48.      bits on and either  the  user  ID  or  group  ID  cannot  be
  49.      preserved,  neither the set user ID or set group ID bits are
  50.      preserved in the copy's permissions.
  51.   For each destination file that already exists, its contents are
  52. overwritten  if  permissions  allow,  but  its mode, user ID, and
  53. group ID are unchanged.
  54.   If the destination file does not exist, the mode of the  source
  55. file  is  used as modified by the file mode creation mask see csh
  56. (1) ) If the source file has its set user ID bit on, that bit  is
  57. removed  unless both the source file and the destination file are
  58. owned by the same user.  If the source file has its set group  ID
  59. bit  on,  that bit is removed unless both the source file and the
  60. destination file are in the same group and the user is  a  member
  61. of that group.  If both the set user ID and set group ID bits are
  62. set, all of the above conditions must be fulfilled or  both  bits
  63. are removed.
  64.   Appropriate permissions  are  required  for  file  creation  or
  65. overwriting.
  66.   Symbolic links are followed unless the option is specified,  in
  67. which case the link itself is copied.
  68.   Cp exits 0 on success, >0 if an error occurred.
  69. SEE ALSO
  70.  
  71.   mv (1) , rcp (1) , umask (2)
  72. HISTORY
  73.  
  74.   The cp command is expected to be compatible.
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.