2012-08-08 2 views
6

주어진 시작 오프셋에서 주어진 (끝) 오프셋까지 파일을 복사하는 도구가 있습니까? 또한 도구가 md5sum을 실행하여 지정된 바이트를 올바르게 복사했는지 확인하고자합니다. 내가 md5sum이 알고이주어진 'x'(시작) 오프셋부터 주어진 'y'(끝) 오프셋까지 파일을 복사하는 도구

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 

같은 일부 것은 -s와 -e의 옵션이 없습니다하지만 원본 파일과 대상 파일을 주어진 몇 가지 도구를 통해 확인하고 싶습니다. 당신이 dd를 사용할 수있는 사전

경우 1

답변

11

)에 감사 : 2의

# dd if=/path/to/source/file of=/path/to/destination/file bs=1 skip=100 count=250 

) 나는 그 표준 도구를 달성 할 수 있는지 정말 모르겠어요. 그것은 완벽하게 작동, 2의

)

# dd if=/path/to/source/file bs=1 skip=100 count=250 | md5sum 

그리고 3)

md5sum /path/to/destination/file 
+0

최고 :

[편집]

아하는 방법을 발견했다. 다시 한번 감사드립니다 :) – Viswesn

+0

환호 :) 너는 천만에. – favoretti

관련 문제