cp for filesystem

Copy files.

Signature

> cp (source) (destination) --recursive --verbose --interactive --no-symlink --progress

Parameters

  • source: the place to copy from
  • destination: the place to copy to
  • --recursive (-r): copy recursively through subdirectories
  • --verbose (-v): show successful copies in addition to failed copies (default:false)
  • --interactive (-i): ask user to confirm action
  • --no-symlink (-n): no symbolic links are followed, only works if -r is active
  • --progress (-p): enable progress bar

Examples

Copy myfile to dir_b

> cp myfile dir_b

Recursively copy dir_a to dir_b

> cp -r dir_a dir_b

Recursively copy dir_a to dir_b, and print the feedbacks

> cp -r -v dir_a dir_b

Move many files into a directory

> cp *.txt dir_a