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:

    I love meetings with suits. I live for meetings with suits. I love them because I know they had a really boring week and I walk in there with my orange velvet leggings and drop popcorn in my cleavage and then fish it out and eat it. I like that. I know I’m entertaining them and I know that they know. Obviously, the best meetings are with suits that are intelligent, because then things are operating on a whole other level.
    Madonna [Madonna Louise Ciccione] (b. 1959)

    Heaven is large, and affords space for all modes of love and fortitude. Why should we be busybodies and superserviceable?
    Ralph Waldo Emerson (1803–1882)