DITTO(8)                    System Manager's Manual                   DITTO(8)

NAME
     ditto - copy files and directories to a destination directory

SYNOPSIS
     ditto [-v] [-V] [-arch arch] [-bom bom] [-rsrcFork] src ... dst_directory
     ditto [-v] [-V] [-arch arch] [-rsrcFork] src_file ... dst_file

DESCRIPTION
     In the first synopsis form, ditto copies one or more source files or
     directories to a destination directory. If the destination directory does
     not exist it will be created before the first source is copied. If the
     destination directory already exists then the source directories are
     merged with the previous contents of the destination.

     In the second synopsis form, ditto copies a file to the supplied
     dst_file. The parent directory for dst_file must exist, otherwise ditto
     will fall back to the first synopsis form.

     ditto overwrites existing files, symbolic links, and devices in the des-
     tination when these are copied from a source. The resulting files, links,
     and devices will have the same mode, owner, and group as the source items
     from which they are copied.  ditto does not modify the mode, owner, or
     group of existing directories in the destination. Files cannot overwrite
     directories or vice-versa.

     ditto can be used to "thin" multi-architecture binaries during a copy.
     ditto can also copy files selectively based on the contents of a BOM
     ("Bill of Materials") file.  ditto preserves hardlinks present in the
     source directories and preserves setuid and setgid modes. Finally, ditto
     can also preserve resource fork and HFS meta-data information when copy-
     ing files within or between file systems.

OPTIONS
     -v    Print a line of output for each source directory copied.

     -V    Print a line of output for every file, symbolic link, and device
           copied.

     -arch arch
           Thin multi-architecture binaries ("fat binaries") to the specified
           architecture. If multiple -arch options are specified then the
           resulting destination file will be multi-architectural containing
           each of the specified architectures (if they are present in the
           source file).  arch should be specified as "ppc", "i386", etc.

     -bom bom
           If this option is given then only files, links, devices, and direc-
           tories that are present in the specified BOM file are copied.

     -rsrcFork
           Preserve resource forks and HFS meta-data.  ditto will store this
           data in AppleDouble files on file-systems that do not support
           resource forks.

EXAMPLES
     The command:
           ditto src_directory dst_directory
     copies the contents of src_directory into dst_directory, creating
     dst_directory if it does not already exist.

     The command:
           ditto src_directory dir/dst_directory
     copies the contents of src_directory into dir/dst_directory, creating dir
     and dst_directory if they don't already exist.

     The command:
           ditto src-1 ... src-n dst_directory
     copies the contents of all of the src directories into dst_directory,
     creating dst_directory if it does not already exist.

     The command:
           ditto -arch ppc fat_file thin_file
     copies the contents of fat_file into thin_file, thinning executable code
     to ppc-only on the fly.

ERRORS
     ditto returns 0 if a copy finishes successfully, otherwise non-zero.
     Diagnostic messages will be printed to standard error.

BUGS
     ditto doesn't copy directories into directories in the same way as cp(1).
     In particular,
           ditto foo bar
     will copy the contents of foo into bar, whereas
           cp -r foo bar
     copies foo itself into bar. Though this is not a bug, some may consider
     this bug-like behavior.

SEE ALSO
     bom(5), lsbom(8), mkbom(8)

Mac OS X                        April 13, 2001                        Mac OS X