Is there a way to do -A and -B without including the matched line in the output? #2951
-
I want the output to be the line above what i'm matching rg -A 1 "Name:" this does show the lines above, but also includes the lines with Name: How can I achieve this? |
Beta Was this translation helpful? Give feedback.
Answered by
BurntSushi
Dec 21, 2024
Replies: 1 comment
-
Yes. With shell pipelines: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
BurntSushi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes. With shell pipelines:
rg -A 1 "Name:" | rg -v "Name:"
.