Monday, September 26, 2011

One Useful Command on OSX

DITTO(1)                  BSD General Commands Manual                 DITTO(1)

NAME
     ditto -- copy directory hierarchies, create and extract archives

SYNOPSIS
     ditto [-v] [-V] [-X] [<options>] src ... dst_directory
     ditto [-v] [-V] [<options>] src_file dst_file
     ditto -c [-z | -j | -k] [-v] [-V] [-X] [<options>] src dst_archive
     ditto -x [-z | -j | -k] [-v] [-V] [<options>] src_archive ...
           dst_directory
     ditto -h | --help

DESCRIPTION
     In its first 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 its second form, ditto copies a file to the supplied dst_file path-
     name.

1.this command can create folder if target folder don't exist
2.this command can replace file if target file exist.

No comments:

Post a Comment