Cp command, cp command details
You can use the cp command to copy files and directories. In addition to copying files, the cp command can also create shortcuts.
Cp (copy a file or directory)
[Root @ www ~] # Cp [-adfilprsu] to use the source object (destination) [root @ www ~] # Cp [options] source1 source2 soure3 .... directory Options and parameters:-a: equivalent to-pdr. For pdr, see the following description. (commonly used)-d: if the source file is a link file ), copy the link file property instead of the file itself.-f: force indicates that the target file already exists and cannot be enabled, and then try again.-I: if the destination file (destination) already exists, when overwriting, the system will first ask the action for (commonly used)-l: to create a hard link file, instead of copying the file itself;-p: Copies the file together with its attributes, rather than using the default attributes (commonly used for backup);-r: recursive continuous replication, used for directory replication; (commonly used)-s: Copies a symbolic link file (symbolic link), that is, a "shortcut" file;-u: Updates dest only when destination is earlier than source. Ination!
When copying a directory, you must add the-r parameter. Remember! Of course, the-a parameter is generally used for directory replication. It includes the-r parameter and will be copied together with the file attributes! Note that if there are more than two source files, the last target file must be a "directory!