TotalNET Advanced Server 5.2 Reference Manual

tncp

This command copies a source file or directory and its corresponding shadow file information to a destination file or directory. This command overwrites destination files that have the same name as the source file, unless you specify the -i option. The source and destination directories must have unique names. For more information, refer to the UNIX cp man page.

Location

TNHOME/usr/bin

Usage

tncp [-f] [-i] [-p] file1 file2
tncp [-f] [-i] [-p] file... dir
tncp [-f] [-i] [-p] [-R] dir1 dir2

Options

-f 

Copy a file and its shadow file, attempt to remove and unlink the destination file, and proceed with the copying process. The removal and unlinking only happen if the destination file exists but has no "write" permission. 

-i 

Prompt for confirmation before overwriting an existing target file or directory. 

-p 

Copy a file and its shadow file to another file, while preserving the file attributes. 

file1 

Specify a source file to copy to a destination file. 

file2 

Specify a destination file or new file name to which the source file can copy. 

file 

Specify a source file to copy to a destination directory. 

dir 

Specify a destination directory or new directory name to which the source file can copy. 

-R 

Copy a directory and every file or directory under it, along with all associated shadow files, to another directory. 

dir1 

Specify a source directory to copy to a destination directory. 

dir2 

Specify a destination directory or new directory name to which the source directory can copy. 

Examples

  1. Use the following command to copy the file report.doc and rename it schedule.doc:


    tncp report.doc schedule.doc
  2. Use the following command to copy the files chapter1.doc and chapter2.doc to the directory manuals:


    tncp chapter1.doc chapter2.doc manuals
  3. Use the following command to copy the directory bookfiles, along with all files and directories under it, to the directory manuals:


    tncp -R bookfiles manuals
  4. Use the following command to copy intro.doc to preface.doc but attempt to unlink preface.doc first, if it exists and has the "write" permission off:


    tncp -f intro.doc preface.doc
  5. Use the following command to copy the file agenda.ppt to the existing file report.ppt and prompt for confirmation before overwriting report.ppt:


    tncp -i agenda.ppt report.ppt
  6. Use the following command to copy the file logo.gif to the file graphic.gif, along with attributes of logo.gif:


    tncp -p logo.gif graphic.gif
  7. Use the following command to copy all files under the directory system, and their associated shadow files, to the directory etc:


    tncp -R system etc