Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Handy but `dd` is much better at giving you a limited context to look at - `dd bs=1 skip=236162504 count=20' just gives you 8 before and 12 after.

(edit: I do have to concede that the `tail|head` version is much faster than the `dd` - ~11s vs ~65s in my quick test with that ^skip)



I suspect you'd get better performance increasing the blocksize, and if necessary trimming the output in a second pass.

Large blocks -> efficient I/O. Within reason.


A note here: if you're using GNU dd, you can also use iflag=count_bytes and then set the block-size to whatever you want. That'll give you the best of both worlds.


Ah, good to know. With a block size of 1M, that brings the `dd` version down to ~15s.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: