Skip to main content
added 315 characters in body
Source Link
peterph
  • 31.5k
  • 3
  • 74
  • 76

You could use dd along the lines of:

dd if=log skip=xK bs=1M 

which would skip x * 1024 blocks of size 1M (2^20). See dd(1) for details on its handling of units.

If you'd like to automate the binary search, assuming your log has the usual formar <date> [data] you can pipe the output to head -n 2, check the date on the beginning of the second line (which - under the reasonable assumption of "normally" long lines - will be complete) and decide what half you want.

You could use dd along the lines of:

dd if=log skip=xK bs=1M 

which would skip x * 1024 blocks of size 1M (2^20). See dd(1) for details on its handling of units.

You could use dd along the lines of:

dd if=log skip=xK bs=1M 

which would skip x * 1024 blocks of size 1M (2^20). See dd(1) for details on its handling of units.

If you'd like to automate the binary search, assuming your log has the usual formar <date> [data] you can pipe the output to head -n 2, check the date on the beginning of the second line (which - under the reasonable assumption of "normally" long lines - will be complete) and decide what half you want.

Source Link
peterph
  • 31.5k
  • 3
  • 74
  • 76

You could use dd along the lines of:

dd if=log skip=xK bs=1M 

which would skip x * 1024 blocks of size 1M (2^20). See dd(1) for details on its handling of units.