Windows command find : looking for a string OR another

7

Using the find command, I'd like to look for a string or another.

It seems this is not possible, but I'd like to make sure I didn't overlook a way to do it.

Jérôme

Posted 2010-09-30T13:30:15.457

Reputation: 187

Do you mean DOS or CMD? – Bobby – 2010-09-30T19:32:33.210

I mean CMD ! I updated my question – Jérôme – 2010-10-01T08:01:00.067

Answers

9

If, by chance, you are talking about Windows command line (which is not DOS), then there is findstr:

findstr "one two three"

Yes, quoted as single argument. Alternative syntax which allows spaces in strings:

findstr /c:"one" /c:"two"

findstr claims to support regular expressions, but I could not get one|two to work.

user1686

Posted 2010-09-30T13:30:15.457

Reputation: 283 655

0

I don't believe you can do this with the dos find command.

However you can do this with grep - there's a windows/dos version of grep available with the GNUWin utilities at Sourceforge.

misterjaytee

Posted 2010-09-30T13:30:15.457

Reputation: 1 763