4 ms·
That answer does not seem very useful to me. The use cases are different. Reasons to use dd include being able to set the block size, seek and skip to resume c
by xorcist 6y ago
That answer does not seem very useful to me. The use cases are different.
Reasons to use dd include being able to set the block size, seek and skip to resume copies or extract parts of the data, and a whole bunch of special options for the very specific use case of large binary files or block devices.
Reasons to use cp include it being file based, so metadata and recursive copying is natural, efficient, and easy to use. This probably includes most copying on a daily basis. See also rsync.
- jeroenhd 6y agoOne advantage dd has, specifically when it comes to copying physical media, is that you can tell it to continue in case of a read error, instead of crapping out halfway through. The lack of such functionality can make copying a scratched CD quite challenging with tools like cat or cp. You also have the choice to ignore the data that could not be read (dangerous) or to write a padded block of the correct size in its place and continue. I agree that the use cases for all tools are different so comparing them fairly is impossible. dd is still my go-to for making disk images, but it's unnecessary and has high overhead without a lot of tweaking for simple tasks like file operations. cat is often a good tool for things like piped commands where you need a flag cat supports (so you can't use shell redirection) and cp/rsync are obviously superior for copying files rather than just data. Sure, uu could hack my commandsin such a way that one tool can do another's job, but why would I?
- IgorPartola 6y agoNotice that they way they use cp isn’t to copy the files contained on the disc but to copy the image of the disc itself.