grep CLI syntax: how to find A OR B?
I can't get figure out how to alternation to work on the command line. Something like this doesn't work:
$ grep \(the\|and\) somefile.txt nor this: $ grep "(the|and)" somefile.txt What's the secret? |
Try:
Code:
egrep 'the|land' somefile |
What anomie said, or you could try:
Code:
grep -e the -e and somefile.txt |
Just what I was looking for, thanks.
|
All times are GMT -5. The time now is 08:24 PM. |