1. CP
Copying files
How to use CP source destination
-R or-R: Recursive replication
–p Preserve original attributes (timestamp, genus, etc.) while copying
–L Copy a link to a file
–P Copy the linked file itself instead of copying the pointing file
–d Copy the link file itself, not to trace the file that the source link file points to
–a Archive replication, commonly used for backup equivalent to -dr plus --preference=all
--preferenc=all: Preserve file metadata properties while copying
–L Copy is the link to the file, and -P opposite
–i If the destination file exists, you are prompted to overwrite
Several rules:
(1). SRC is a file and if the destination file does not exist, a new dest is created and the SRC content is populated into the dest
(2). SRC is a file, if the target file exists, it will be overwritten with SRC content in the Dest file, it is recommended to use the-I option for the CP command, before overwriting will remind the user whether to overwrite
(3). SRC is a file, and if the target file is a directory, a new file with the same name as the source file is created directly under Dest and the SRC content is filled in
(4). SRC is multiple files, the dest must exist, and the directory
(5). SRC is a directory, you need to use the-r option for recursive replication, if the dest does not exist, then create the Dest directory, if the dest is a directory, copy the past directly, if Dest is a file, then the error
2.MV command:
Move files or rename
The MV does not have the-r option, so when the SRC time directory does not require the option to move directly
-I: Whether interactive reminders overwrite
3.RM command:
-I interactive reminder whether to overwrite
-F Force Delete
-R Recursive Delete, used to delete directories
This article is from the "After Tomorrow" blog, please be sure to keep this source http://leeyan.blog.51cto.com/8379003/1685772
File Management related commands