{"id":2456,"date":"2014-11-08T09:36:03","date_gmt":"2014-11-08T14:36:03","guid":{"rendered":"http:\/\/microdevsys.com\/wp\/?p=2456"},"modified":"2016-05-29T15:22:54","modified_gmt":"2016-05-29T19:22:54","slug":"grep-in-windows-with-findstr","status":"publish","type":"post","link":"https:\/\/microdevsys.com\/wp\/grep-in-windows-with-findstr\/","title":{"rendered":"grep in windows with findstr"},"content":{"rendered":"<p>\n\tLife in Linux would be far more difficult without grep. So what&#39;s the equivalent in Windows?\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">C:\\Users\\tom&gt;netstat -na|findstr 3389<br \/>\n\tTCP 0.0.0.0:3389 0.0.0.0:0 LISTENING<br \/>\n\tTCP [::]:3389 [::]:0 LISTENING<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">C:\\Users\\tom&gt;<\/span>\n<\/p>\n<p>\n\tVery neat! But now how to alias this guy. Well, we can do this but it doesn&#39;t quite work in pipes:\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">C:\\Users\\tom&gt;doskey grep=c:\\windows\\system32\\findstr.exe $*<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">C:\\Users\\tom&gt;doskey \/macros<br \/>\n\tgrep=c:\\windows\\system32\\findstr.exe $*<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">C:\\Users\\tom&gt;grep<br \/>\n\tFINDSTR: Bad command line<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">C:\\Users\\tom&gt;<\/span>\n<\/p>\n<p>\n\tHave fun with that.\n<\/p>\n<p>\n\tCheers,<br \/>\n\tTom<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Life in Linux would be far more difficult without grep. So what&#39;s the equivalent in Windows? C:\\Users\\tom&gt;netstat -na|findstr 3389 TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING TCP [::]:3389 [::]:0 LISTENING C:\\Users\\tom&gt; Very neat! But now how to alias this guy. Well, we can do this but it doesn&#39;t quite work in pipes: C:\\Users\\tom&gt;doskey grep=c:\\windows\\system32\\findstr.exe $* C:\\Users\\tom&gt;doskey \/macros grep=c:\\windows\\system32\\findstr.exe [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[1541],"class_list":["post-2456","post","type-post","status-publish","format-standard","hentry","category-unix-linux-admin-stuff","tag-grep-in-windows-findstr"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/2456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/comments?post=2456"}],"version-history":[{"count":2,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/2456\/revisions"}],"predecessor-version":[{"id":3129,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/2456\/revisions\/3129"}],"wp:attachment":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/media?parent=2456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/categories?post=2456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/tags?post=2456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}