Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash grep for two terms in same line

# Basic syntax:
grep first_word input_file | grep second_word
# Where:
#	- this finds all lines that contain the first_word and then pipes them
# 	  to a second filter that looks for the second_word, resulting in all
# 	  lines that contain both words. Simply add more pipes and greps to 
# 	  return lines that meet other search criteria. 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #grep #terms #line
ADD COMMENT
Topic
Name
2+3 =