The grep command is a powerful command-line utility used to search for specific patterns in text and then print the lines that match those patterns. The name grep is an acronym for "globally search for a regular expression and print it out".
Sample.txt
Hello World
Hi there
How are you
Just do-it
Believe it
banana
papaya
mango
Much ado about nothing
He he he
Adios amigo
Code.txt
fruit = []
fruit[0] = 'apple'
def fruit():
print('banana')
10. For both input files - display matching lines based on the search terms (one per line) present in the terms.txt file. Results should be prefixed with the corresponding input filename.
terms.txt
are
not
go
fruit[0]
$ grep -Ff terms.txt sample.txt code.txt
sample.txt:How are you
sample.txt:mango
sample.txt:Much ado about nothing
sample.txt:Adios amigo
code.txt:fruit[0] = 'apple'