{"id":295213,"date":"2024-12-27T20:09:12","date_gmt":"2024-12-27T12:09:12","guid":{"rendered":"https:\/\/gulass.cn\/lmlxjkssswjd.html"},"modified":"2024-12-27T20:09:12","modified_gmt":"2024-12-27T12:09:12","slug":"lmlxjkssswjd","status":"publish","type":"post","link":"https:\/\/gulass.cn\/lmlxjkssswjd.html","title":{"rendered":"Linux locate\u547d\u4ee4\u8be6\u89e3\uff1a\u5feb\u901f\u641c\u7d22\u6587\u4ef6\u7684\u65b9\u6cd5\u4e0e\u6ce8\u610f\u4e8b\u9879"},"content":{"rendered":"
\u4e00.locate\uff08\u641c\u7d22\u6587\u4ef6\uff09<\/p>\n
1.\u547d\u4ee4<\/a>\u683c\u5f0f<\/p>\n locate\u6587\u4ef6\u540d<\/p>\n \u8bf4\u660e\uff1alocate\u547d\u4ee4\u4e0d\u5728\u7cfb\u7edf\u4e2d\u641c\u7d22\u6587\u4ef6\uff08\u5373\u4e0d\u904d\u5386\u6574\u4e2a\u7cfb\u7edf\uff09linux \u901a\u914d\u7b26\u7684\u4f7f\u7528<\/strong>\uff0c\u800c\u662f\u5728\/var\/lib\/mlocate\uff08centos7\u4e2d\u56e0\u6b64\u76ee\u5f55\uff0c\u53ef\u4f7f\u7528locatelocate\u547d\u4ee4\u67e5\u770b\u6b64\u76ee\u5f55\u8def\u5f84\uff09\u6570\u636e\u5e93\u4e2d\u641c\u7d22\uff0c\/var\/lib\/mlocate\u6570\u636e\u5e93\u9ed8\u8ba4\u6bcf\u665a\u66f4\u65b0\u4e00\u6b21\uff0c\u8981\u67e5\u627e\u65b0\u521b\u5efa\u7684\u6587\u4ef6\u5c31\u8981\u53bb\u66f4\u65b0\uff08\u901a\u8fc7updatedb\u547d\u4ee4\uff09\u6b64\u6570\u636e\u5e93\u540e\u518d\u8fdb\u884c\u641c\u7d22<\/p>\n 2.\u4f18\u70b9<\/p>\n \u5728\u540e\u53f0\u6570\u636e\u5e93\u4e2d\u6309\u6587\u4ef6\u540d\u8fdb\u884c\u641c\u7d22\uff0c\u6240\u4ee5\u641c\u7d22\u901f\u7387\u5feb<\/p>\n 3.\u7f3a\u70b9<\/p>\n \u53ea\u80fd\u6309\u6587\u4ef6\u540d\u641c\u7d22<\/p>\n 4.\u6ce8\u610f<\/p>\n locate\u6839\u636e\u914d\u7f6e\u6587\u4ef6\/etc\/updatedb.conf\u8fdb\u884c\u641c\u7d22\uff0c\u914d\u7f6e\u6587\u4ef6\u7684\u5185\u5bb9\u5982\u53f3\u56fe<\/p>\n <\/p>\n <\/p>\n PRUNE_BIND_MOUNTS=\"yes\"\u8868\u793a\u5f00\u542f\u641c\u7d22\u9650\u5236<\/p>\n PRUNE_BIND_MOUNTS=\"no\"\u8868\u793a\u5173\u6389\u641c\u7d22\u9650\u5236<\/p>\n PRUNEFS\u8868\u793a\u641c\u7d22\u65f6\u4e0d\u641c\u7d22\u7684\u6587\u4ef6\u7cfb\u7edf<\/p>\n PRUNENAMES\u8868\u793a\u641c\u7d22\u65f6\u4e0d\u641c\u7d22\u7684\u6587\u4ef6\u7c7b\u578b<\/p>\n PRUNEPATHS\u8868\u793a\u641c\u7d22\u65f6\u4e0d\u641c\u7d22\u7684\u8def\u5f84<\/p>\n \u4e8c.whereis\uff08\u641c\u7d22\u547d\u4ee4\uff09<\/p>\n 1.\u547d\u4ee4\u683c\u5f0f<\/p>\n whereis\u547d\u4ee4\u540d<\/p>\n \u8bf4\u660e\uff1a\u641c\u7d22\u5916\u90e8\u547d\u4ee4\u6240\u5728\u8def\u5f84\u53ca\u5e2e\u52a9\u6587\u6863\u6240\u5728\u4f4d\u7f6e\uff08Linux<\/a>\u7684shell\u5916\u7f6e\u547d\u4ee4\u4e0d\u80fd\u901a\u8fc7whereis\u627e\u5230\u547d\u4ee4\u8def\u5f84\uff0c\u53ea\u80fd\u770b\u89c1\u5e2e\u52a9\u6587\u6863\u7684\u8def\u5f84\uff0c\u5982pwd\u3001cd\uff09<\/p>\n -b\u53ea\u67e5\u770b\u547d\u4ee4\u6240\u5728\u4f4d\u7f6e\uff08\u5373\u547d\u4ee4\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff09<\/p>\n -m\u53ea\u67e5\u627e\u5e2e\u52a9\u6587\u6863\u6240\u5728\u4f4d\u7f6e<\/p>\n <\/p>\n \u4e09.which\uff08\u641c\u7d22\u547d\u4ee4\uff09<\/p>\n 1.\u547d\u4ee4\u683c\u5f0f<\/p>\n which\u547d\u4ee4\u540d<\/p>\n <\/p>\n