cp
for filesystem
Copy files.
Signature
> cp (source) (destination) --recursive --verbose --update --interactive --no-symlink --progress
Parameters
source
: the place to copy fromdestination
: the place to copy to--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
Input/output types:
input | output |
---|---|
nothing | nothing |
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
Copy only if source file is newer than target file
> cp -u a b