Copy command: CP
CP [OPTION] ... [-T] SOURCE DEST
CP [OPTION] ... SOURCE ... DIRECTORY
CP [OPTION] ...-t DIRECTORY SOURCE ...
CP SRC DEST
src is a file:
If the target does not exist: Creates a new dest and fills the contents of SRC into the dest;
If the directory exists:
If Dest is a file: overwrites the contents of SRC into the dest;
It is recommended to use the-I option for the CP command;
If Dest is a directory: Create a new file with the same name as the original file under Dest, and populate the contents of SRC with the new file;
CP SRC ... DEST
SRC ... : Multiple Files
dest must exist and be directory, other situations will be error;
CP SRC DEST
src is the directory:
use option at this time:-R
If Dest does not exist: creates the specified directory and copies all files in the SRC directory to dest;
if dest exists:
If Dest is a file: Error
If Dest is a directory:
Common options:
-I: Interactive
-R,-r: recursively copy directories and all internal content;
-A: archive, equivalent to-DR--preserv=all
-d:--no-dereference--preserv=links
--preserv[=attr_list]
Mode: Permissions
ownership: Belong to the main group
Timestamp:
Links
xattr
Context
All
-P:--preserv=mode,ownership,timestamp
-V:--verbose
-F:--force
Mv:move, moving files
MV [OPTION] ... [-T] SOURCE DEST
MV [OPTION] ... SOURCE ... DIRECTORY
MV [OPTION] ...-t DIRECTORY SOURCE ...
Common options:
-I: Interactive
-F: Mandatory
Rm:remove, deleting
rm [OPTION] ... FILE ...
Common options:
-I: Interactive
-F: Force delete
-R: Recursive
RM-RF
[Command Detail] File management