1. Cp command options

Command options instructions
-i Interactive prompt
-r Recursively copy directories and their contents
-v The copied path description is displayed
-a Retain the original permissions of files

Cp -i command option:



Cp -r command option effect picture:



Cp -v command options:



Cp -a command option effect picture:



-a Options:

  • The -a option also supports copying folders without losing permissions on files in folders

2. Mv option

Command options instructions
-i Interactive prompt
-v Displays the path description after the move

Mv -i command option:



Mv-v command option effect picture:

3. Summary

  • Copy files to prevent overwriting, run cp -i
  • To copy a folder, use cp -r. To copy the folder without losing the file permission, use cp -A.
  • Move files to prevent overwriting using the MV -I operation
  • Use mv to move folders. Mv can also rename files and folders.

note

If you have any questions or suggestions, please add wechat: 13960699696.