Cp: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 7: Line 7:


==-R==
==-R==
If source_file designates a directory, cp copies the directory and the entire subtree connected at that point.  If the source_file ends in a /, the contents of the directory are copied rather than the directory
          itself.  This option also causes symbolic links to be copied, rather than indirected through, and for cp to create special files rather than copying them as normal files.  Created directories have the same mode as
          the corresponding source directory, unmodified by the process' umask.
          In -R mode, cp will continue copying even if errors are detected.
          Note that cp copies hard-linked files as separate files.  If you need to preserve hard links, consider using tar(1), cpio(1), or pax(1) instead.


==-r==
==-r==


Historic option for copying recursively. It is deprecated, use [[#-R|-R]] instead.
Historic option for copying recursively. It is deprecated, use [[#-R|-R]] instead.

Revision as of 02:06, 27 December 2020

Internal

Overview

Options

-R

If source_file designates a directory, cp copies the directory and the entire subtree connected at that point. If the source_file ends in a /, the contents of the directory are copied rather than the directory

          itself.  This option also causes symbolic links to be copied, rather than indirected through, and for cp to create special files rather than copying them as normal files.  Created directories have the same mode as
          the corresponding source directory, unmodified by the process' umask.
          In -R mode, cp will continue copying even if errors are detected.
          Note that cp copies hard-linked files as separate files.  If you need to preserve hard links, consider using tar(1), cpio(1), or pax(1) instead.

-r

Historic option for copying recursively. It is deprecated, use -R instead.