Difference between revisions of "Cp"

From wikieduonline
Jump to navigation Jump to search
(Created page with "<code>cp</code><ref>http://man7.org/linux/man-pages/man1/cp.1.html</ref> command is used for copying files and directories. It lacks progress bar indicator<ref...")
 
Line 13: Line 13:
  
 
== See also ==
 
== See also ==
* <code>[[linux/Basic commands/rsync|rsync]]</code>, advanced copy and synchronization tool including progress indicator
+
* <code>[[rsync]]</code>, advanced copy and synchronization tool including progress indicator
 
* <code>progress</code> <ref>https://github.com/Xfennec/progress</ref>: Linux tool to show progress for cp, mv, dd. See also: [[pv]]<ref>https://linux.die.net/man/1/pv</ref> (Pipe Viewer). Example: <code>progress -m</code>
 
* <code>progress</code> <ref>https://github.com/Xfennec/progress</ref>: Linux tool to show progress for cp, mv, dd. See also: [[pv]]<ref>https://linux.die.net/man/1/pv</ref> (Pipe Viewer). Example: <code>progress -m</code>
 
* <code>[[scp]]</code>, <code>[[dd (Unix)|dd]]</code>, <code>[[mv]]</code>
 
* <code>[[scp]]</code>, <code>[[dd (Unix)|dd]]</code>, <code>[[mv]]</code>

Revision as of 06:05, 17 December 2019

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

  1. Understand the differences between cp, scp and rsync: https://stackoverflow.com/questions/20244585/how-does-scp-differ-from-rsync
  2. Understand --sparse option and usage cases
  3. Learn how to not overwrite a file with -n, --no-clobber option[5] or using rsync -a -v --ignore-existing src dst

See also

  • rsync, advanced copy and synchronization tool including progress indicator
  • progress [6]: Linux tool to show progress for cp, mv, dd. See also: pv[7] (Pipe Viewer). Example: progress -m
  • scp, dd, mv

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

Advertising: