{"id":738,"date":"2019-04-18T16:45:40","date_gmt":"2019-04-18T08:45:40","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=738"},"modified":"2022-05-26T12:56:32","modified_gmt":"2022-05-26T04:56:32","slug":"locate","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/locate","title":{"rendered":"locate\u547d\u4ee4 – \u5feb\u901f\u67e5\u627e\u6587\u4ef6\u6216\u76ee\u5f55"},"content":{"rendered":"\n

locate\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u5feb\u901f\u67e5\u627e\u6587\u4ef6\u6216\u76ee\u5f55\u3002\u4e0efind\u547d\u4ee4\u8fdb\u884c\u5168\u5c40\u641c\u7d22\u4e0d\u540c\uff0clocate\u547d\u4ee4\u662f\u57fa\u4e8e\u4e86\u6570\u636e\u6587\u4ef6\uff08\/var\/lib\/locatedb\uff09\u8fdb\u884c\u7684\u5b9a\u70b9\u67e5\u627e\uff0c\u7531\u4e8e\u7f29\u5c0f\u4e86\u641c\u7d22\u8303\u56f4\uff0c\u56e0\u6b64\u5feb\u901f\u5feb\u5f88\u591a\u3002<\/p>\n\n\n\n

Linux\u7cfb\u7edf\u9700\u5b9a\u671f\u6267\u884c\u4e0bupdatedb\u547d\u4ee4\u5bf9\u6570\u636e\u5e93\u6587\u4ef6\u8fdb\u884c\u66f4\u65b0\uff0c\u7136\u540e\u518d\u4f7f\u7528locate\u547d\u4ee4\u8fdb\u884c\u67e5\u627e\uff0c\u8fd9\u6837\u624d\u4f1a\u66f4\u52a0\u51c6\u786e\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>locate [\u53c2\u6570] \u6587\u4ef6<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-d<\/td>\u6307\u5b9a\u6570\u636e\u5e93\u6240\u5728\u7684\u76ee\u5f55 <\/td><\/tr>
--help<\/td>\u663e\u793a\u5e2e\u52a9 <\/td><\/tr>
--version <\/td>\u663e\u793a\u7248\u672c\u4fe1\u606f <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong> <\/p>\n\n\n\n

\u641c\u7d22\u5e26\u6709\u6307\u5b9a\u5173\u952e\u8bcd\u7684\u6587\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# updatedb <\/strong>\n[root@linuxcool ~]# locate network<\/strong>\n\/dev\/network_latency\r\n\/dev\/network_throughput\r\n\/etc\/networks\r\n\/etc\/libvirt\/qemu\/networks\r\n\/etc\/libvirt\/qemu\/networks\/autostart\r\n\/etc\/libvirt\/qemu\/networks\/default.xml\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n\n\n\n

\u5728\u6307\u5b9a\u7684\u76ee\u5f55\u4e0b\uff0c\u641c\u7d22\u5e26\u6709\u6307\u5b9a\u5173\u952e\u8bcd\u7684\u6587\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# locate \/etc\/network<\/strong>\n \/etc\/networks<\/pre>\n","protected":false},"excerpt":{"rendered":"

locate\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u5feb\u901f\u67e5\u627e\u6587\u4ef6\u6216\u76ee\u5f55\u3002\u4e0efind\u547d\u4ee4\u8fdb\u884c\u5168\u5c40\u641c\u7d22\u4e0d\u540c\uff0clocate\u547d\u4ee4\u662f\u57fa\u4e8e\u4e86\u6570\u636e\u6587 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/738"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=738"}],"version-history":[{"count":12,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/738\/revisions"}],"predecessor-version":[{"id":10058,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/738\/revisions\/10058"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}