Answers for "grep two strings in same file"

2

bash print lines that match any of several words

# Basic syntax:
grep 'word1|word2|word3' /path/to/file
# This prints all lines that match word1, word2, OR, word3
Posted by: Guest on October-04-2020
0

grep get everything between two strings

echo "Here is a string" | grep -o -P '(?<=Here).*(?=string)'
Posted by: Guest on September-22-2021
-2

grep in multiple files

grep -E 'fatal|error|critical|failure|warning|' *.log
Posted by: Guest on September-02-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language