By default, ccp only copies a source file if it is missing from the target directory, has a different size on the target directory, or has a different modification date and time on the target directory. The behavior of ccp can be altered by the following flags:
-l | (letter el) If a file with the same name as a source file exists in the target directory, copy the source file only if its modification time is later than that of the file in the target directory. In other words, only copy source files that are later than those in the target. | ||
-d | If the target directory doesn't already exist, create
it before attempting to copy any files to it.
Note that if you specify -s with or without -d, ccp always creates any path components within the target directory that don't already exist. | ||
-e | If a file with the same name as a source file doesn't exist in the target directory, then don't copy the source file. In other words, only copy files that already exist in the target. | ||
-f | Force copy even if target file is read-only. | ||
-n | Just display the names of source files that
would have been copied, but don't actually copy any files. If
the -d flag is also specified and the target
directory doesn't exist, then the target directory is also not
actually created.
The -n flag is an excellent way to see just what files would be copied and which files would be excluded without actually copying anything. | ||
-s | Descend subdirectories while searching for files
to copy, just as XCOPY /S does. The subdirectory
structure (relative to the source directory) is preserved
within the target directory. When a file is copied, any
subdirectories that don't already exist within the target
directory are created by ccp.
If the specified target directory doesn't exist, it is not created unless the -d flag is also specified. The -s flag without -d only creates subdirectories within the target directory but never creates the target directory. | ||
-S | Also copy system and hidden files.
Since system files are quite often also read-only files, the -S flag should usually be combined with the -f flag to force updates. Be very careful when updating system and hidden files! | ||
-t | For each file copied, show the path and name of
each target file in addition to the path and name of each
source file, as follows:
| ||
-x | Also display the names of source files that are
being excluded (not copied). One of the following characters
is displayed in front of each filename that ccp is
excluding from copying:
|