[Cialug] Efficiently removing the beginning of a file

Daniel A. Ramaley daniel.ramaley at DRAKE.EDU
Mon May 21 13:44:48 CDT 2007


On Monday 21 May 2007 13:01, Chris Freeman wrote:
>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.

I completely forgot about tail. This command:
    $ tail -c +3636 inputfile > outputfile
ran in about 2.5 seconds, as fast as dd with a block size of 3635. And 
unlike dd, tail should continue to perform well even as the number of 
bytes at the beginning of the file to be skipped (and thus the input 
block size that can be used with dd) decreases. I think tail is the 
general solution i was looking for but didn't think of. Thanks!

------------------------------------------------------------------------
Dan Ramaley                            Dial Center 118, Drake University
Network Programmer/Analyst             2407 Carpenter Ave
+1 515 271-4540                        Des Moines IA 50311 USA


More information about the Cialug mailing list