{"id":2076,"date":"2016-10-19T23:31:30","date_gmt":"2016-10-19T21:31:30","guid":{"rendered":"http:\/\/blog.techmedia.pl\/?p=2076"},"modified":"2020-11-12T00:10:40","modified_gmt":"2020-11-11T23:10:40","slug":"find-file-name-which-contain-a-centrain-string-using-grep-and-find","status":"publish","type":"post","link":"https:\/\/www.techmedia.pl\/blog\/find-file-name-which-contain-a-centrain-string-using-grep-and-find\/","title":{"rendered":"Find file name which contain a centrain string using grep and find"},"content":{"rendered":"<p>If you only want to find the file names that have a certain string without showing the matching line:<\/p>\n<pre>root@server:\/# <strong>find . -type f -print0 | xargs -0 grep -l \"string\"<\/strong><\/pre>\n<p>and you want to exclude file name that containing certain string:<\/p>\n<pre>root@server:\/# <strong>find . -type f -print0 | xargs -0 grep -l \"string\" | grep -v \"string2\"<\/strong><\/pre>\n<p>Finding file name that have certain name:<\/p>\n<pre>root@server:\/# find . -type f -name \"some_name*.*\"<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you only want to find the file names that have a certain string without showing the matching line: root@server:\/# find . -type f -print0 | xargs -0 grep -l &#8222;string&#8221; and you want to exclude file name that containing certain string: root@server:\/# find . -type f -print0 | xargs -0 grep -l &#8222;string&#8221; | [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[299],"tags":[250,48,38],"yst_prominent_words":[],"_links":{"self":[{"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/posts\/2076"}],"collection":[{"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/comments?post=2076"}],"version-history":[{"count":4,"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/posts\/2076\/revisions"}],"predecessor-version":[{"id":2989,"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/posts\/2076\/revisions\/2989"}],"wp:attachment":[{"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/media?parent=2076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/categories?post=2076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/tags?post=2076"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.techmedia.pl\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=2076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}