{"id":175,"date":"2015-08-27T10:26:28","date_gmt":"2015-08-27T10:26:28","guid":{"rendered":"http:\/\/toolbox.pingvinfeszek.hu\/?p=175"},"modified":"2016-02-16T10:03:31","modified_gmt":"2016-02-16T09:03:31","slug":"grep-whole-directory-file-extension-only","status":"publish","type":"post","link":"https:\/\/wp.gaborhargitai.hu\/grep-whole-directory-file-extension-only\/","title":{"rendered":"Grep whole directory recursively by file extension only"},"content":{"rendered":"
Using grep<\/strong> to scan thru a whole directory recursively is done with:<\/p>\n In addition, you can also tell grep to only scan files that have a certain extension (or pattern, for that matter):<\/p>\n <\/p>\n","protected":false},"excerpt":{"rendered":" Using grep to scan thru a whole directory recursively is done with: grep -R ‘string’ dir\/ In addition, you can also tell grep to only scan files that have a certain extension (or pattern, for that matter): grep -R ‘string’ –include *.cpp dir\/ <\/p>\n","protected":false},"author":1,"featured_media":228,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,6,7],"tags":[],"_links":{"self":[{"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/posts\/175"}],"collection":[{"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/comments?post=175"}],"version-history":[{"count":2,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/posts\/175\/revisions"}],"predecessor-version":[{"id":227,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/posts\/175\/revisions\/227"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/media\/228"}],"wp:attachment":[{"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/media?parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/categories?post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/tags?post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}grep -R 'string' dir\/<\/code><\/p>\n
grep -R 'string' --include *.cpp dir\/<\/code><\/p>\n