I have very long log files, is it possible to ask grep to only search the first 10 lines?
head -10 log.txt | grep -A 2 -B 2 pattern_to_search
-A 2: print two lines before the pattern.
-A 2
-B 2: print two lines after the pattern.
-B 2
head -10 log.txt # read the first 10 lines of the file.