How to use grep to search for two regex at the same time. Say, I am looking for “My name is” and “my bank account ” in a text like:
My name is Mike. I'm 16 years old.
I have no clue how to solve my grep problem,but
if I manage to solve it, then I'll transfer
you some money from my bank account.
I’d like grep to return:
My name is
my bank account
Is it possible to do it with just one grep call or should I write a script to do that for me?
If you do not care about a trailing newline, simply use
grep:If you would prefer a trailing newline, use
awk: