Hi,
is there a way to use grep to check for more than 1 word?
Like both for left and right
grep right AND left
grep multiple words
-
chris
- Site Admin
- Posts: 216
- Joined: Mon Jul 21, 2008 9:52 am
Re: grep multiple words
grep has an -E option (--extended-regexp)
This allows to us regular expressions.
You can check for more than 2:
This allows to us regular expressions.
Code: Select all
grep -E 'right|left' name_of_file.txt
Code: Select all
grep -E 'right|left|up|down' name_of_file.txt