Linux Study Notes-cp command (copy)
Cp: English Name copy.
1. Command Format:
Cp [Option] source file or directory target file or directory cp [Option] source file 1 source file 2 source file 3... target directory
2. Common options:
"Cp-a" is equivalent to "cp-pdr" "cp-B". If a file with the same name already exists in the target directory, back up "cp-d" before deleting or overwriting the target file. If the source file is a linked file, copy the link property "cp-f" to force the file, if there are duplicates, the user will not be asked, and the forced copy "cp-I" if the target file already exists, the system will first confirm "cp-l" to create a hard link during overwriting, it is equivalent to "ln" command "cp-p" Copied together with file attributes "cp-r" recursive replication, used for directory replication behavior "cp-s" to create soft links, it is equivalent to the "ln-s" command, that is, the shortcut "cp-u" in windows. If the target file is earlier than the source file, it is copied and updated.
3. Common examples
1) copy the file to another location
2) Copy multiple files at the same time
3) copy a directory
<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4NCjxwcmUgY2xhc3M9 "brush: SQL;"> 4) create a hard link
5) create a soft link
6) if a file with the same name already exists in the target directory, a backup file is created.