Remove x number of lines from beginning of file

Steve smorrey at gmail.com
Thu Oct 25 16:52:38 MDT 2007


What about using nice and running it at a higher priority?

On 10/25/07, Shane Hathaway <shane at hathawaymix.org> wrote:
> Jon Gale wrote:
> > [root at linuxboy root]# time sed -i -e '1,4d' test.txt
> >
> > real    1m13.596s
> > user    0m18.020s
> > sys     0m52.930s
> >
> > test2.txt is only 100 lines.  test.txt is 10,000,000 lines.
> >
> > Is there a better way to do this that won't necessitate scanning the entire
> > file just to remove the first x number of lines?
>
> The majority of that time is spent in I/O, not computation.  The best
> way to accomplish this would be to write the output to a different hard
> drive with similar specs, enabling you to use the combined throughput of
> both drives.
>
> Shane
>
>
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */
>



More information about the PLUG mailing list