{"id":5963,"date":"2012-11-28T07:00:00","date_gmt":"2012-11-28T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2012\/11\/28\/why-are-there-both-find-and-findstr-programs-with-unrelated-feature-sets\/"},"modified":"2012-11-28T07:00:00","modified_gmt":"2012-11-28T07:00:00","slug":"why-are-there-both-find-and-findstr-programs-with-unrelated-feature-sets","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20121128-00\/?p=5963","title":{"rendered":"Why are there both FIND and FINDSTR programs, with unrelated feature sets?"},"content":{"rendered":"<p>Jonathan wonders <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2011\/08\/25\/10200026.aspx#10200433\"> why we have both <code>find<\/code> and <code>findstr<\/code><\/a>, and furthermore, why the two programs have unrelated features. The <code>find<\/code> program supports UTF-16, which <code>findstr<\/code> doesn&#8217;t; on the other hand, the <code>findstr<\/code> program supports regular expressions, which <code>find<\/code> does not.\n The reason why their feature sets are unrelated is that the two programs are unrelated.\n The <code>find<\/code> program came first. As I noted in the article, <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2011\/08\/25\/10200026.aspx\"> the <code>find<\/code> program dates back to 1982<\/a>. When it was ported to Windows&nbsp;NT, Unicode support was added. But nobody bothered to add any features to it. It was intended to be a straight port of the old MS-DOS program.\n Meanwhile, one of my colleagues over on the MS-DOS team missed having a <code>grep<\/code> program, so he wrote his own. Developers often write these little tools to make their lives easier. This was purely a side project, not an official part of any version of MS-DOS or Windows. When he moved to the Windows&nbsp;95 team, he brought his little box of tools with him, and he ported some of them to Win32 in his spare time because, well, that&#8217;s what programmers do. (This was back in the days when programmers loved to program <i>anything<\/i> in their spare time.)\n And that&#8217;s where things stood for a long time. The official <code>find<\/code> program just searched for fixed strings, but could do so in Unicode. Meanwhile, my colleague&#8217;s little side project supported regular expressions but not Unicode.\n And then one day, the Windows 2000 Resource Kit team said, &#8220;Hey, that&#8217;s a pretty cool program you&#8217;ve got there. Mind if we include it in the Resource Kit?&#8221;\n &#8220;Sure, why not,&#8221; my colleague replied. &#8220;It&#8217;s useful to me, maybe it&#8217;ll be useful to somebody else.&#8221;\n So <a href=\"http:\/\/www.microsoft.com\/download\/en\/details.aspx?displaylang=en&amp;id=17657\"> in it went<\/a>, under the name <code>qgrep<\/code>.\n Next, the Windows Resource Kit folks said, &#8220;You know, it&#8217;s kind of annoying that you have to go install the Resource Kit just to get these useful tools. Wouldn&#8217;t it be great if we put the most useful ones in the core Windows product?&#8221; I don&#8217;t know what sort of cajoling was necessary, but they convinced the Windows team to add a handful of Resource Kit programs to Windows. Along the way, <code>qgrep<\/code> somehow changed its name to <code>findstr<\/code>. (Other Resource Kit programs kept their names, like <code>where<\/code> and <code>diskraid<\/code>.)<\/p>\n<p> So there you have it. You can think of the <code>find<\/code> and <code>findstr<\/code> programs as examples of parallel evolution. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jonathan wonders why we have both find and findstr, and furthermore, why the two programs have unrelated features. The find program supports UTF-16, which findstr doesn&#8217;t; on the other hand, the findstr program supports regular expressions, which find does not. The reason why their feature sets are unrelated is that the two programs are unrelated. [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[2],"class_list":["post-5963","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>Jonathan wonders why we have both find and findstr, and furthermore, why the two programs have unrelated features. The find program supports UTF-16, which findstr doesn&#8217;t; on the other hand, the findstr program supports regular expressions, which find does not. The reason why their feature sets are unrelated is that the two programs are unrelated. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/5963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=5963"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/5963\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=5963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=5963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=5963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}