how to print one line after the given grep pattern
grep's -A 1 option will give you one life after; -B 1 will give you one line before; and -C 1 combines both to give you one line both before and after.
example : dig google.com |grep -A 1 "ANSWER SECTION" |grep -v "ANSWER SECTION"
No comments:
Post a Comment