The command MV for renaming files or folders under Linux can be renamed, and files or folders can be moved.
Example: Renaming directory A to B
MV A B
Example: Move the/a directory to/b and rename to C
mv/a/b/c
Linux copies all files in the specified directory to another directory
Copy all files in the specified directory to another directory
The copying of files and directories is often used. The commands for copying under Linux are CP.
Assume that the replication source directory is dir1 and the destination directory is DIR2. How can I copy all the files under the Dir1 to Dir2?
If the Dir2 directory does not exist, you can use it directly
Cp-r Dir1 Dir2
Can.
If the Dir2 directory already exists, you need to use the
Cp-r dir1/. Dir2
If the Cp-r dir1 Dir2 is used at this point, the Dir1 directory will also be copied to Dir2, which is clearly not in line with the requirements.
Ps:dir1, Dir2 change to the corresponding directory path.
Cp-r/home/www/xxx/statics/. /home/www/statics
If there are files that need to be deleted first
rm-rf/home/www/statics/*
Otherwise you will be prompted to confirm the file, using CP-RF also prompt
Linux Operations Command