Answers for "grep regex match"

0

linux grep regex return match

-o, --only-matching Show only the part of a matching line that matches PATTERN.

$ egrep -o 'key w+' file 
key word1
key word2
Posted by: Guest on October-27-2021
-1

grep or match

$ grep "PATTERN1|PATTERN2" FILE
$ grep -E "PATTERN1|PATTERN2" FILE
$ grep -e PATTERN1 -e PATTERN2 FILE
$ egrep "PATTERN1|PATTERN2" FILE
Posted by: Guest on April-12-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language