In computing, cp is a command in various Unix and Unix-like operating systems for copying files and directories. The command has three principal modes of operation, expressed by the types of arguments presented to the program for copying a file to another file, one or more files to a directory, or for copying entire directories to another directory. The utility further accepts various command line option flags to detail the operations performed. The two major specifications are POSIX cp and GNU cp. GNU cp has many additional options over the POSIX version. The command is also available in the EFI shell. History cp was part of Version 1 Unix. The version of cp bundled in GNU coreutils was written by Torbjorn Granlund, David MacKenzie, and Jim Meyering. 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. Usage Copying a file to another file: cp [-fHip][--] sourcefile targetfile Copying file(s) to a directory cp [-fHip] [--] sourcefile... targetdirectory Copying a directory to a directory (-r or -R must be used) cp -r|-R [-fHip] [--] sourcedirectory... targetdirectory Option flags -f (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command. -H (dereference) – makes the cp command follow symbolic links (symlinks) so that the destination has the target file rather than a symlink to the target. -i (interactive) – prompts with the name of a file