Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cp(1) — DG/UX 4.30

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cpio(1)

rm(1)

mvdir(1m)

chmod(2)



     cp(1)                      DG/UX 4.30                       cp(1)



     NAME
          cp, ln, mv - copy, link or move files

     SYNOPSIS
          cp file1 [ file2 ...] target
          ln [ -f ] [ -s ] file1 [ file2 ...] target
          mv [ -f ] file1 [ file2 ...] target

     DESCRIPTION
          File1 is copied (linked, moved) to target.  File1 and target
          can never be the same (take care when using sh(1)
          metacharacters).  If target is a directory, then file1,
          file2, ...  are copied (linked, moved) to that directory.
          If target is a file, only one file can be copied (linked,
          moved) and target  is destroyed.

          If mv or ln determines that the mode of target forbids
          writing, it will print the mode (see chmod(2)), ask for a
          response, and read the standard input for one line.  If the
          line begins with y, the mv or ln occurs, if permissible; if
          not, the command exits.  No questions are asked and the mv
          or ln is done (if permissible) if the standard input is not
          a terminal, or, in DG/UX, when the -f option is used.  A mv
          or ln is permissible only if the user has write and execute
          permission in the target directory.

          By default ln makes hard links.  A hard link to a file is
          indistinguishable from the original directory entry; any
          changes to a file are effective independent of the name used
          to reference the file.  Hard links may not span file systems
          and may not refer to directories.

          The -s option causes ln to create symbolic links.  A
          symbolic link contains the name of the file to which it is
          linked.

          Only mv will allow file1 to be a directory; the directory
          named file1 is renamed target. For mv and ln, if file1 is a
          file and target is a link to another file with links, the
          other links remain and target becomes a new file.

          If target does not exist or is a directory, a new file or
          files are created with the same owner, group, and
          permissions as file1, file2, ....  The sticky bit of the new
          files is cleared unless you are a superuser.  If target is a
          file, copying a file into target does not change its mode,
          owner, or group.  The last modification time of target (and
          last access time, if target did not exist) and the last
          access time of file1 are set to the time the copy was made.
          If target is a link to a file, all links remain and the file
          is changed.




     Licensed material--property of copyright holder(s)         Page 1





     cp(1)                      DG/UX 4.30                       cp(1)



     EXAMPLES
          $ cp oldfile newfile

          Copies the contents of "oldfile" to "newfile" in the current
          working directory without destroying the contents of
          "oldfile".

          $ cp /dir/cp.c $HOME

          Copies the contents of "/dir/cp.c" to a file with the same
          name and permissions as "cp.c" in your "HOME" directory.

          $ cp memo attach MEMODIR

          Copies the contents of the files "memo" and "attach" in the
          current working directory to the subdirectory "MEMO_DIR".
          The names of the new files are the same as the original
          files.

     SEE ALSO
          cpio(1), rm(1).
          mvdir(1m) in the System Manager's Reference for the DG/UX
          System.
          chmod(2) in the Programmer's Reference for the DG/UX System,
          Volume 1.

     BUGS
          If file1 and target lie on different file systems, mv must
          copy the file and delete the original.  In this case any
          linking relationship with other files is lost.

          Ln will not hard link across file systems.























     Licensed material--property of copyright holder(s)         Page 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026