cp Linux command of

cp command is mainly used to copy files and directories, the same time with some options, you can achieve (intact) to copy the entire directory

Options:

  • -a: equivalent to -d, -p, -r option of the set, these options we introduced one by one;
  • -d: If the source file is a soft link (hard link does not work), then copy the target file is also soft link;
  • -i: ask, if the target file already exists, you are asked whether to overwrite;
  • -l: the establishment of the target file hard-linked files as source files rather than copy the source files;
  • -s: the establishment of the target file for the source file soft link files instead of copying the source file;
  • -p: After you copy the target file to retain the properties of the source file (including the owner, owning group, permissions, and time);
  • -r: recursive copy, for copying directories;
  • -u: If the target file has differences than the source file, use this option to update the target file, this option can be used to upgrade and file backup.

Guess you like

Origin www.cnblogs.com/xq0422/p/12060191.html