3 ms·
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
by zimpenfish 4y ago
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)
- dredmorbius 4y agoI 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.
- nrclark 4y agoA 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.
- zimpenfish 4y agoAh, good to know. With a block size of 1M, that brings the `dd` version down to ~15s.