Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

grep second match

#Combine grep and tail for grepping until second match and filtering 
#last with tail command
grep -m2 "two" in-file.txt | tail -n1
 
PREVIOUS NEXT
Tagged: #grep #match
ADD COMMENT
Topic
Name
1+6 =