PDA

View Full Version : how to copy a directory.


bsdnewbie999
07-12-2008, 03:30 PM
What is the command to copy a directory ?

BSDfan666
07-12-2008, 03:36 PM
Why, cp of coarse. ;)

-R If source designates a directory, cp copies the directory and the
entire subtree connected at that point. Created directories have
the same mode as the corresponding source directory, unmodified
by the process's umask.

This option also causes symbolic links to be copied, rather than
followed, and special files to be created, rather than being
copied as normal files. However, cp copies hard linked files as
separate files. To preserve hard links, use a utility such as
pax(1) or tar(1) instead.