1

I have a large file, and I want to show all lines after a match. Right now I am doing this:

cat file | grep -A99999 "FOO"

Basically this command would break if that file is longer than 99999 lines, is it possible to grep all lines after a match?

John Winston
  • 1,260
  • 15
  • 30
  • I believe you can find the answer here: https://unix.stackexchange.com/questions/56429/how-to-print-all-lines-after-a-match-up-to-the-end-of-the-file – Supertech Oct 03 '22 at 01:15
  • 2
    Not with `grep` but with `sed` or `awk` yes – anubhava Oct 03 '22 at 05:33
  • `awk '/FOO/{f=1} f' file` which is idiom "a" at [printing-with-sed-or-awk-a-line-following-a-matching-pattern](https://stackoverflow.com/questions/17908555/printing-with-sed-or-awk-a-line-following-a-matching-pattern/17914105#17914105). – Ed Morton Oct 03 '22 at 18:44

0 Answers0