cp:copy
CP SRC DEST
-R Recursive replication
-I interactive Tips
-F forcibly overwrite
-P Maintain original properties (ownership timestamp)
-A: Archive replication, often used for backups (keep all attributes of the file)
-P: Copy is link generated is the link
-D: Keep links
Copy command
Only one file to one file
Multiple files to a directory
A file to a directory
EG1: cp/etc/{passwd,inittab,rc.d/rc.sysinit}/tmp/copy three files to the TMP directory
EG2: cp/etc/passwd/tmp/Copy the passwd to the TMP directory
eg3: cp/etc/passwd/tmp/test
If the test is a directory, it is copied to the test directory, and if it is a file, overwrite the file and rename it to test.
cp/etc/init.d//tmp/hello can copy directories to a directory that is not created
The target of replication is only one, and the source can have multiple
If there are multiple sources, the target can only be a directory
Mv:move Moving files
MV SRC DEST
Mv-t DEST SRC
MV name rename files and directories can be renamed
EG1: [Email protected] tmp]# MV/TMP/ROOT.INITTAB/VAR/TMP/ABC
If ABC does not exist, rename the file to ABC, and if present, overwrite and rename ABC; If ABC is a directory, move the file to the ABC directory
EG2: [Email protected] tmp]# mv/tmp/hello//VAR/TMP/ABC
If ABC exists and is a directory, it is to move the Hello directory to the ABC directory, if ABC does not exist, it is to move the Hello directory to/var/tmp and renamed to ABC
Install: Copying files and Setting properties
-D direcotry ... : Creating a Directory
SRC DEST can only copy files
-M can specify permissions
Install-t DIRECTORY SRC ...
This article is from the "Sailing" blog, be sure to keep this source http://it6789.blog.51cto.com/6971671/1709372
Linux basic Commands (iv)--file management