find /?
prints:
Searches for a text string in a file or files.
and
findstr /?
prints:
Searches for strings in files.
What is the difference between these two?
find /?
prints:
Searches for a text string in a file or files.
and
findstr /?
prints:
Searches for strings in files.
What is the difference between these two?
findstr
has way more options than find
, for example, /B to look only at the respective beginning of each line. Further, even the matching functionality has a different syntax.
Concerning the question why Microsoft would keep both instead of just extending one with the features of the other I can just speculate:
As a software developer I know that in many cases it is hard to extend an existing command with new features without breaking backwards-compatibility - which is very important when talking about operating systems. So, the easy solution is to introduce a new command and wait for the users to forget about the deprecated one. Which may never happen.
A slightly different explanation can be found for commands like rd
and rmdir
. While the former is originating from the original MS DOS the latter is part of the UNIX tradition. It makes sense to keep both to make it comfortable for programmers familiar with only one of these. I don't know if there is an explanation in the history of find
, though.