How to grep a string after a specified line number? December 21, 2023 by Tarik You can tail it, then grep: tail -n +50000 myfile.txt | grep -in "time spent"