Cp (Unix) - Operating Modes

Operating Modes

Cp has three principal modes of operation. These modes are inferred from the type and count of arguments presented to the program upon invocation.

  • When the program has two arguments of path names to files, the program copies the contents of the first file to the second file, creating the second file if necessary.
  • When the program has one or more arguments of path names of files and following those an argument of a path to a directory, then the program copies each source file to the destination directory, creating any files not already existing.
  • When the program's arguments are the path names to two directories, cp copies all files in the source directory to the destination directory, creating any files or directories needed. This mode of operation requires an additional option flag, typically r, to indicate the recursive copying of directories. If the destination directory already exists, the source is copied into the destination, while a new directory is created if the destination does not exist.

Read more about this topic:  Cp (Unix)

Famous quotes containing the words operating and/or modes:

    ... the modern drama, operating through the double channel of dramatist and interpreter, affecting as it does both mind and heart, is the strongest force in developing social discontent, swelling the powerful tide of unrest that sweeps onward and over the dam of ignorance, prejudice, and superstition.
    Emma Goldman (1869–1940)

    The essence of belief is the establishment of a habit; and different beliefs are distinguished by the different modes of action to which they give rise.
    Charles Sanders Peirce (1839–1914)