4

Besides the explanations from the man pages and --help information, in which way do the commands dd, cp and rsync differ when used to copy files? In which context is each of these superior to the others, for some definition of 'superior', so that it should get preference of use?

closed as too broad by Kusalananda, roaima, Jeff Schaller, GAD3R, muru Jan 23 '17 at 1:58

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Although I agree that the question is extremely broad and doesn't show that the man pages were actually read, the answer received seems to address it fairly well. For this reason, I think it should not be closed. – Julie Pelletier Jan 21 '17 at 3:02
  • Thanks for this comment. I have read the --help and man pages but I don't see an advantage in 'showing' that I have done it. The purpose of the question is indeed to eschew the technical jargon and have guidance around it. Which jargon may be daunting confusing to the novice. We have received a pretty thorough and to-the-point answer. – XavierStuvw Jan 21 '17 at 8:55
10

They are completely different animals that better fit on different file or device manipulation cases:

dd

This command was created as a "copy and convert" utility, originally intended for converting files between the ASCII, little-endian, byte-stream world of DEC computers and the EBCDIC, big-endian, appearing at the first time on Unix Version 5. It became the de facto command utility to manipulate everything that can be mapped as a file inside your Unix-like operating system(clone a disc, backup of mbr, clone a disk as file, copy some blocks of one device file, write an image to a usb stick..), and piped to other commands, the sky is the limit. One alternative to this software is the dcfldd command.

dd related stuff:

cp

Make copy of files and directories. This is a more "higher" level of abstraction, where you can copy directories recursively, without caring about block size, file conversion, etc. It is a better tool to deal with "1-to-many" cases of file copy, ownership, symbolic link follow, recursively copy, and verbosity. However, it has it's limitations like dealing with file changes, remote copy, and those things better handled by rsync.

cp related stuff:

rsync

Can to copy files inside the same computer, but it's features are more useful on remote copy scenarios. Some of the features are ownership handling/manipulation, more easy "exclude" expressions for a better copy, file checksum to see if a file was already copied, delete origin files during or after copu, the use of a "transparent shell" by invoking the protocol wanted using a specific URI(ssh://, rsync://...), pipelining and other stuff that create optimized environment for remote mirroring things.

rsync related stuff:

Further Reading:

  • 1
    dd is also nicknamed Disk Destroyer – ychaouche May 6 '18 at 17:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.