Syn: $ cp [option] [source path] [destination path]
Options: -i: Interactive. Prompt for confirmation whenever the copy would overwrite an existing file. A y in answer confirms that the copy should proceed. Any other answer prevents cp from overwriting the file.
-p: Preserve. Duplicate not only the contents of the original file or directory, but also the modification time and permission modes.
-R: Recursive. If any of the source files are directories, copy the directory along with its files (including any subdirectories and their files); the destination must be a directory.
cp refuses to copy a file onto itself.
Ex: $ pwd
/home/user2
To copy X1 directory into Y1.
$ cp –R /home/user2/X/X1 /home/user2/Y/Y1
(Or)
$ cp –R X/X1 Y/Y1
Note: The difference between copy and move command is
After copying a file from source to destination the file is available at both source and destinations.
After moving a file from source to destination the file is available only at destination.