SyntaxFix
Write A Post
Hire A Developer
Questions
The output of head -10 file can be piped to grep in order to accomplish this:
head -10 file
grep
head -10 file | grep …
Using Perl:
perl -ne 'last if $. > 10; print if /pattern/' file