Is there any tool to copy a file from the given starting offset to the given (end) offset. I also want to confirm that the tool has copies specified bytes rightly by running md5sum. Some thing like this
1) Copy source file starting from 100 byte till 250th byte
$cp /path/to/source/file /path/to/dest/file -s 100 -e 250
2) Create md5sum of the source file starting from 100byte till 250th byte
$md5sum /path/of/src/file -s 100 -e 250
xxxxxx-xxxxx-xxxxx-xxxx-xx
3) Confirm that destination file created from step 1 is right by comparing the md5sum generated from step 2.
$md5sum /path/of/dest/file
xxxxxx-xxxxx-xxxxx-xxxx-xx
I know md5sum doesn't have the option of -s and -e but I would like to confirm by some tool given the source file and the destination file. Thanks in advance
For 1) you can use dd
:
# dd if=/path/to/source/file of=/path/to/destination/file bs=1 skip=100 count=250
For 2) I'm not really sure if that's achievable with standard tools.
[edit]
Aha, found a way:
For 2)
# dd if=/path/to/source/file bs=1 skip=100 count=250 | md5sum
And for 3)
md5sum /path/to/destination/file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With