3 ms·
They may have been able to make this command they used: cat /dev/md2 \ | pv -s 1888127576000 \ | grep -P --byte-offset --text 'FLV\x01\x05' \ | tee -a /mnt/
by vram22 6y ago
They may have been able to make this command they used:
cat /dev/md2 \
| pv -s 1888127576000 \
| grep -P --byte-offset --text 'FLV\x01\x05' \
| tee -a /mnt/storagebox/grep-log.txt
somewhat (or a lot) faster by adding a strings command (maybe with an appropriate length arg matching the grep pattern length) to the pipeline after the cat, and removing the pv call, be ause then only the printable ASCII characters woyls be passed to the grep, potentially heavily reducing the work it has to do, depending on the breakup between binary and text data (bytes) on disk.
https://man7.org/linux/man-pages/man1/strings.1.html https://man7.org/linux/man-pages/man1/strings.1.html
- vram22 6y agoSorry, typos above: >be ause then only the printable ASCII characters woyls should be because then only the printable ASCII characters would
- xphx 6y agoThat would invalidate the byte offset. The intention here isn't so much printing the data as its location on disk.
- vram22 6y agoOh yes, of course. My mistake. I did look up all the grep options used, including --byte-offset, before commenting, but somehow your point did not occur to me. Yes, the byte offsets would be meaningless after the data was piped through strings.