W3cubDocs

/Nushell

cp for filesystem

Copy files.

Signature

> cp {flags} (source) (destination)

Flags

  • --recursive, -r: copy recursively through subdirectories
  • --verbose, -v: show successful copies in addition to failed copies (default:false)
  • --update, -u: copy only when the SOURCE file is newer than the destination file or when the destination file is missing
  • --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

Parameters

  • source: the place to copy from
  • destination: the place to copy to

Input/output types:

input output
nothing nothing

Examples

Copy myfile to dir_b

>cpmyfiledir_b

Recursively copy dir_a to dir_b

>cp-rdir_adir_b

Recursively copy dir_a to dir_b, and print the feedbacks

>cp-r-vdir_adir_b

Move many files into a directory

>cp*.txtdir_a

Copy only if source file is newer than target file

>cp-uab

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/cp.html