ByteCopy , or BCP, intends to copy files accurately (down to the bytes) in a simple , safe and efficient manner.
It's functionality , but not implementation, overlaps with that of
dd , and this is by design.
dd uses low-level system calls , non-standard C, has elaborate, (tiresome ?) syntax, and is notorious for failing in mysterious or dangerous ways in inexperienced hands. This is not a defect per se;
dd is an advanced and very precise tool. It was originally written in the times of tape drives, which is also perhaps the reason for some of its peculiarities.
dd has become the default for doing everyday tasks : backups of files, disks, flashing ISOs, etc - sometimes causing serious issues for casual users. In such cases,
bcp functions alike
dd , with the simple syntax of
cp , and is much easier to troubleshoot and understand - while also keeping up with dd's speed by < 1 second and being more reliable, easier to casually use and port to any OS/platform. BCP displays progress by default, asks before overwriting, etc.
BCP does NOT replace or clone
dd in the least -
dd is it's own low-level, advanced utility, and is certainly the go-to for advanced control over the copying; BCP is for the other 90% of the time :)
If you can use
cp , you can use BCP !
bcp [source file] [destination file (optional)] [overwrite ? (y/n) (optional)]
So, BCP must be given at least one argument , the name of the source file.
If given no other arguments, bcp will copy to stdout, meaning you can redirect this further to other programs.
If given another argument, the second argument is treated as the name of the destination file, and the third (if given) is treated as permission for overwriting : this can be "y" or "yes" to confirm or "n" or "no" to deny. If an output file is given but overwrite permissions are not, BCP will ask you explicitly before overwriting.
If this destination file does not exist, it is created.
BCP will treat arguments exactly in the order specified above.
Any arguments beyond the first three, and the third if invalid, are ignored automatically.
bcp ~/.zshrc /mnt/backups/zhrc.bak bcp /dev/sda | gzip > drive.bak bcp settings.json D:\backups\settings.json