Skip to content

Print byte-offset of matches instead of line numbers? #2375

Answered by BurntSushi
Kareem-Emad asked this question in Q&A
Discussion options

You must be logged in to vote

I'm looking up options and I can't find this mentioned in ripgrip docs, is this supported?

Have you tried searching for --byte-offset? It literally has the same flag name (and short flag) as GNU grep.

       -b, --byte-offset
           Print the 0-based byte offset within the input file
           before each line of output. If -o (--only-matching)
           is specified, print the offset of the matching part
           itself.

           If ripgrep does transcoding, then the byte offset is
           in terms of the result of transcoding and not the
           original data. This applies similarly to another
           transformation on the source, such as decompression
           o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kareem-Emad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants