<tt>cp</tt>: Copy



next up previous contents
Next: mv: Move Up: File system Commands: Previous: pwd: Print Working

cp: Copy

To copy the contents of a directory into another directory, the following is used:

where directory1 and directory2 are directories.

The contents of directory1 will be copied into directory2. If directory2 does not exist if will be created. If it exists, a copy of directory1 will be created as a subdirectory of directory2. In both cases, a new directory will be created.

-r
(recursive) is a recursive copy: When a directory is encountered, its files are also copied.
-i
(interactive) will prompt the user for confirmation if a file will get overwritten during the copy.
-p
(preserve) will keep the time-stamps and permissions of the original files.



Super-User
Fri Feb 17 15:55:40 EST 1995