Difference between revisions of "Cp"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | <code>[[wikipedia:Cp_(Unix)|cp]]</code><ref>http://man7.org/linux/man-pages/man1/cp.1.html</ref> command is used for copying | + | <code>[[wikipedia:Cp_(Unix)|cp]]</code><ref>http://man7.org/linux/man-pages/man1/cp.1.html</ref> command is used for copying [[file]]s and [[directory|directories]]. It lacks progress bar indicator<ref>https://unix.stackexchange.com/questions/65077/is-it-possible-to-see-cp-speed-and-percent-copied</ref>, but you can use <code>[[progress]] -w</code> command to display the percentage of copied data or use [[rsync]]<ref>https://stackoverflow.com/questions/6339287/copy-or-rsync-command</ref> command. |
[[Ansible]] also includes a cp module with limited scalability (>hundreds of files) <ref>https://docs.ansible.com/ansible/latest/modules/copy_module.html</ref> | [[Ansible]] also includes a cp module with limited scalability (>hundreds of files) <ref>https://docs.ansible.com/ansible/latest/modules/copy_module.html</ref> |
Revision as of 10:16, 7 January 2020
cp
[1] command is used for copying files and directories. It lacks progress bar indicator[2], but you can use progress -w
command to display the percentage of copied data or use rsync[3] command.
Ansible also includes a cp module with limited scalability (>hundreds of files) [4]
Options
-a, --archive
-l, --link
hard link files instead of copying
Activities
- Understand the differences between cp, scp and rsync: https://stackoverflow.com/questions/20244585/how-does-scp-differ-from-rsync
- Understand
--sparse
option and usage cases - Learn how to not overwrite a file with
-n, --no-clobber
option[5] or usingrsync -a -v --ignore-existing src dst
Related commands
See also
cp
,dd
,sftp
,scp
,rsync
,casync
,mv
,fio
,ln
,docker cp, kubectl cp
,minikube cp
,multipass transfer
,Copy-Item
,Xcopy
progress
[6]: Linux tool to show progress for cp, mv, dd. See also: pv[7] (Pipe Viewer). Example:progress -m
dd
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.
Source: https://en.wikiversity.org/wiki/Linux/Basic_commands/cp
- ↑ http://man7.org/linux/man-pages/man1/cp.1.html
- ↑ https://unix.stackexchange.com/questions/65077/is-it-possible-to-see-cp-speed-and-percent-copied
- ↑ https://stackoverflow.com/questions/6339287/copy-or-rsync-command
- ↑ https://docs.ansible.com/ansible/latest/modules/copy_module.html
- ↑ https://stackoverflow.com/questions/9392735/linux-how-to-copy-but-not-overwrite
- ↑ https://github.com/Xfennec/progress
- ↑ https://linux.die.net/man/1/pv
Advertising: