{"id":793,"date":"2019-12-01T21:20:32","date_gmt":"2019-12-01T13:20:32","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=793"},"modified":"2021-01-19T18:40:41","modified_gmt":"2021-01-19T10:40:41","slug":"linux%e6%96%87%e4%bb%b6%e6%9f%a5%e6%89%be%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=793","title":{"rendered":"linux\u6587\u4ef6\u67e5\u627e\u547d\u4ee4"},"content":{"rendered":"\n<p>\u4e00\u3001find<br>find [\u641c\u7d22\u76ee\u5f55] [ \u641c\u7d22\u6761\u4ef6] [\u6307\u5b9a\u52a8\u4f5c]<br>find -name &#8220;my.*&#8221;<br>find -name &#8220;my.*&#8221; -ls<\/p>\n\n\n\n<p>\u4e8c\u3001locate<br>locate \u7ea6\u7b49\u4e8e find -name\uff0c\u4f46\u6bd4find\u5feb<br>\u5b83\u4e0d\u641c\u7d22\u76ee\u5f55\uff0c\u800c\u662f\u641c\u7d22\u6570\u636e\u5e93(\/var\/lib\/locatedb\u6587\u4ef6\uff09<br>\u6b64\u6570\u636e\u5e93\u6587\u4ef6\u542b\u6709\u672c\u5730\u6240\u6709\u7684\u6587\u4ef6\u4fe1\u606f\uff0clinux\u81ea\u52a8\u521b\u5efa\u6b64DB\uff0c\u5e76\u6bcf\u5929\u66f4\u65b0\u4e00\u6b21\uff0clocate\u547d\u4ee4\u67e5\u4e0d\u5230\u6700\u65b0\u53d8\u5316\u7684\u6587\u4ef6<br>\u4e5f\u53ef\u4ee5\u66f4\u65b0: updatedb \u624b\u52a8\u66f4\u65b0\u6570\u636e\u5e93<br>locate &#8220;my.*&#8221;<\/p>\n\n\n\n<p>\u4e09\u3001whereis<br>\u53ea\u641c\u7d22\u7a0b\u5e8f\u540d\uff08\u4e8c\u8fdb\u5236\u6587\u4ef6\uff09<br>whereis grep<\/p>\n\n\n\n<p>\u56db\u3001which<br>\u5728PATH\u6307\u5b9a\u7684\u8def\u5f84\u4e2d\u641c\u7d22\u67d0\u4e2a\u547d\u4ee4\u7684\u4f4d\u7f6e<br>\u4f7f\u7528\u6b64\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u7cfb\u7edf\u547d\u4ee4\u662f\u5426\u5b58\u5728\uff0c\u4f4d\u7f6e\u5728\u54ea<\/p>\n\n\n\n<p>\u4e94\u3001type<br>type\u7528\u6765\u533a\u5206\u547d\u4ee4\u662fshell\u81ea\u5e26\u7684\uff0c\u8fd8\u662f\u5916\u90e8\u7684<br>\u5982\u679c\u662f\u5916\u90e8\u7684\uff0c\u90a3\u4e48\u4f7f\u7528-p\u53c2\u6570\uff0c\u4f1a\u663e\u793a\u8def\u5f84<br>type cd<\/p>\n\n\n\n<p>\u516d\u3001\u5728OSX\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528mdfind\u547d\u4ee4<br>mdfind -name &#8220;my&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001findfind [\u641c\u7d22\u76ee\u5f55] [ \u641c\u7d22\u6761\u4ef6] [\u6307\u5b9a\u52a8\u4f5c]find -name &#8220;my.*&#038; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/793"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=793"}],"version-history":[{"count":2,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/793\/revisions"}],"predecessor-version":[{"id":2662,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/793\/revisions\/2662"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}