I like 'tail' where 'dd' doesn't work properly. It might not be as fast as an optimal 'dd', but it can't be worse than your experience. I don't have a good place to test right now. Sorry.
<br><br>Chris<br><br><div><span class="gmail_quote">On 5/21/07, <b class="gmail_sendername">Daniel A. Ramaley</b> <<a href="mailto:daniel.ramaley@drake.edu">daniel.ramaley@drake.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have a ~70 MB file. The first 3635 bytes need to be removed. What is<br>the most efficient way to do that? I did this, knowing it would work<br>but would be slow:<br> $ dd if=inputfile of=outputfile ibs=1 obs=1M skip=3635
<br>It did indeed work. But it took 274 seconds (and pegged the CPU the<br>entire time), whereas simply copying the file with cp only takes 2<br>seconds. Since what i want to do is not *that* different an action from<br>just copying the file (at least in terms of the minimum disk operations
<br>that would be required), it seems to me that there should be a way to<br>do it that only takes ~2 seconds. What are some other command line ways<br>to do this that would be more efficient?<br><br>Actually, before hitting send i tried another test, just flipping the
<br>"ibs" and "skip" values:<br> $ dd if=inputfile of=outputfile2 ibs=3635 obs=1M skip=1<br>That only took 2.5 seconds, which is much closer to the theoretical 2<br>second time that should be possible. But i guess what i'm curious about
<br>is the general problem; if there is a large file and you need to remove<br>some small number of bytes from the beginning of it, how is that best<br>accomplished? If i had needed to remove only 1 byte for example, i<br>
would have had to have used "ibs=1 skip=1" which would have taken<br>around 274 seconds again.<br><br>------------------------------------------------------------------------<br>Dan Ramaley Dial Center 118, Drake University
<br>Network Programmer/Analyst 2407 Carpenter Ave<br>+1 515 271-4540 Des Moines IA 50311 USA<br>_______________________________________________<br>Cialug mailing list<br><a href="mailto:Cialug@cialug.org">
Cialug@cialug.org</a><br><a href="http://cialug.org/mailman/listinfo/cialug">http://cialug.org/mailman/listinfo/cialug</a><br></blockquote></div><br>