Tag Archive: grep

Jul 03

Grep for Multiple Words

You can grep for two (or more) words at once. For example, create a file containing: One Two Three Four Five Then use the following grep command (the -E option enables extended regular expressions, which lets you use the | as an “or” operator): grep -E ‘One|Two|Three’ file.txt Output is: One Two Three