{"id":272142,"date":"2023-05-15T04:06:54","date_gmt":"2023-05-14T20:06:54","guid":{"rendered":"https:\/\/lrxjmw.cn\/lzczwjdml.html"},"modified":"2023-05-15T04:06:54","modified_gmt":"2023-05-14T20:06:54","slug":"lzczwjdml","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lzczwjdml.html","title":{"rendered":"Linux\u4e2d\u67e5\u627e\u6587\u4ef6\u7684\u547d\u4ee4"},"content":{"rendered":"
<\/p>\n
Linux<\/a>\u4e2d\u67e5\u627e\u6587\u4ef6\u7684\u547d\u4ee4<\/a>\u6709\u597d\u591a\uff0c\u53ef\u80fd\u4f60\u4eec\u666e\u904d\u7528\u5230\u6bd4\u8f83\u591a\u7684\u662ffind\uff0c\u4f46locate\u3001whereis\u3001which\u4e5f\u662f\u6bd4\u8f83\u597d\u7528\u7684\u67e5\u627e\u547d\u4ee4\u3002<\/p>\n \u5b83\u4eec\u7684\u4e3b\u8981\u533a\u522b\u662f\uff1a<\/p>\n find\uff1a\u662f\u4e2a\u5f88\u5f3a\u608d\u7684\u67e5\u627e\u547d\u4ee4\uff0c\u80fd\u505a\u5230\u5b9e\u65f6\u67e5\u627e\uff0c\u7cbe\u786e\u67e5\u627e\uff0c\u4f46\u67e5\u627e\u5185\u5bb9\u8f83\u591a\u65f6\u901f\u7387\u6162\uff0c\u6548\u7387\u4f4e<\/p>\n locate\uff1a\u67e5\u627e\u901f\u7387\u5feblinux \u7248\u672c\uff0c\u4f46\u4e0d\u662f\u5b9e\u65f6\u67e5\u627e\uff0c\u67e5\u627e\u7684\u7ed3\u679c\u4e0d\u7cbe\u786e<\/p>\n whereis\uff1a\u7528\u4e8e\u67e5\u627e\u4e8c\u8865\u7801\u6587\u4ef6\u3001\u6e90\u4ee3\u7801\u6587\u4ef6\u548c\u5e2e\u52a9\u6307\u5357\uff1b<\/p>\n which\uff1a\u4f1a\u5728\u73af\u5883\u53d8\u91cf$PATH\u8bbe\u7f6e\u7684\u76ee\u5f55\u91cc\u67e5\u627e\u7b26\u5408\u6761\u4ef6\u7684\u6587\u4ef6<\/p>\n 1<\/p>\n find\u67e5\u627e\u6587\u4ef6<\/p>\n find\u62ff\u6765\u5728\u6307\u5b9a\u76ee\u5f55\u4e0b\u67e5\u627e\u6587\u4ef6\u3002<\/p>\n \u4efb\u4f55\u5750\u843d\u53c2\u6570\u4e4b\u524d\u7684\u5b57\u7b26\u4e32\u90fd\u5c06\u88ab\u89c6\u4e3a\u6b32\u67e5\u627e\u7684\u76ee\u5f55\u540d\u3002<\/p>\n <\/p>\n \u5047\u5982\u4f7f\u7528\u8be5\u547d\u4ee4\u65f6\uff0c\u4e0d\u8bbe\u7f6e\u4efb\u4f55\u53c2\u6570\uff0c\u5219find\u547d\u4ee4\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u67e5\u627e\u5b50\u76ee\u5f55\u4e0e\u6587\u4ef6\u3002\u800c\u4e14\u5c06\u67e5\u627e\u5230\u7684\u5b50\u76ee\u5f55\u548c\u6587\u4ef6\u5168\u90e8\u8fdb\u884c\u663e\u793a\u3002<\/p>\n find<\/p>\n path\uff1a\u6240\u8981\u641c\u7d22\u7684\u76ee\u5f55\u53ca\u5176\u6240\u6709\u5b50\u76ee\u5f55\u3002\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u3002<\/p>\n expression\uff1a\u6240\u8981\u641c\u7d22\u7684\u6587\u4ef6\u7684\u7279\u70b9\u3002<\/p>\n -cminn:\u5728\u8fc7\u53bbn\u5206\u949f\u5185\u88ab\u66f4\u6539\u8fc7<\/p>\n -ctimen:\u5728\u8fc7\u53bbn\u5929\u5185\u88ab\u66f4\u6539\u8fc7\u7684\u6587\u4ef6<\/p>\n -mtimen\uff1a\u5728\u8fc7\u53bbn\u5929\u5185\u88ab\u66f4\u6539\u8fc7\u7684\u6587\u4ef6<\/p>\n -mminn\uff1a\u5728\u8fc7\u53bbn\u5206\u949f\u5185\u88ab\u66f4\u6539\u8fc7<\/p>\n -empty:\u7a7a\u7684\u6587\u4ef6\uff0c\u627e\u5bfb\u6587\u4ef6\u5927\u5c0f\u4e3a0Byte\u7684\u6587\u4ef6\uff0c\u6216\u76ee\u5f55\u4e0b\u6ca1\u6709\u4efb\u4f55\u5b50\u76ee\u5f55\u6216\u6587\u4ef6\u7684\u7a7a\u76ee\u5f55\uff1b<\/p>\n -ipathp,-pathp:\u5339\u914d\u6587\u4ef6\u8def\u5f84\u9a6c\u54e5linux\uff0cipath\u4f1a\u5ffd\u89c6\u8def\u5f84\u5927\u5c0f\u5199<\/p>\n -namename\uff0c-inamename:\u5339\u914d\u6587\u4ef6\u540d\u79f0\u3002iname\u4f1a\u5ffd\u89c6\u540d\u79f0\u5927\u5c0f\u5199<\/p>\n -sizen:\u5339\u914d\u6587\u4ef6\u5927\u5c0f\uff0c\u5355\u4f4d\u6709\uff1ac--\u5b57\u8282\uff0ck--\u5343\u5b57\u8282\uff0cM--\u5146\u5b57\u8282\uff0cG--GB<\/p>\n -typec:\u5339\u914d\u6587\u4ef6\u7c7b\u578b\uff0cc\u662f\u6307\u5b9a\u7684\u7c7b\u578b\u3002(\u6587\u4ef6\u7c7b\u578b\u53c2\u6570\u6709\uff1af--\u666e\u901a\u6587\u4ef6\uff0cd--\u76ee\u5f55\uff0cl--\u7b26\u53f7\u94fe\u63a5)<\/p>\n -exec\uff1a\u5047\u5b9afind\u6307\u4ee4\u7684\u56de\u4f20\u503c\u4e3aTrue\uff0c\u5c31\u6267\u884c\u8be5\u6307\u4ee4\uff1b<\/p>\n -ok\uff1a\u6b64\u53c2\u6570\u7684\u7597\u6548\u548c\u6307\u5b9a\u201c-exec\u201d\u7c7b\u4f3c\uff0c\u4f46\u5728\u6267\u884c\u6307\u4ee4\u4e4b\u524d\u4f1a\u5148\u5bfb\u95ee\u7528\u6237\uff0c\u82e5\u56de\u7b54\u201cy\u201d\u6216\u201cY\u201d\uff0c\u5219\u820d\u5f03\u6267\u884c\u547d\u4ee4\uff1b<\/p>\n -regex\uff1a\u6307\u5b9a\u5b57\u7b26\u4e32\u4f5c\u4e3a\u627e\u5bfb\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u8303\u672c\u5f0f\u6837<\/p>\n \u5c06\u5f53\u524d\u76ee\u5f55\u53ca\u5176\u5b50\u76ee\u5f55\u4e0b\u6240\u6709.py\u540e\u7f00\u7684\u6587\u4ef6\u5217\u4e0b\u6765\uff1a<\/p>\n find.-name\"*.py\"<\/p>\n find.-iname\"*.py\"<\/p>\n \u5339\u914d\u6587\u4ef6\u8def\u5f84\u6216\u5219\u6587\u4ef6\uff1a<\/p>\n <\/p>\n find\/usr\/-path\"*local*\"<\/p>\n \u57fa\u4e8e\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u6587\u4ef6\u8def\u5f84\uff1a<\/p>\n find.-regex\".*(.txt|.doc)$\"<\/p>\n \uff08\u67e5\u627e\u5f53\u524d\u76ee\u5f55\u53ca\u5b50\u76ee\u5f55\u4e0b\u6240\u6709\u4ee5.txt\u6216.doc\u7ed3\u5c3e\u7684\u6587\u4ef6\uff09<\/p>\n \u67e5\u627e\u8fd1\u67653\u5929\u5185\u88ab\u8bbf\u95ee\u8fc7\u7684\u6240\u6709\u6587\u4ef6\uff1a<\/p>\n find.-typef-atime-3<\/p>\n \u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u67e5\u627e\u6587\u4ef6\u5bbd\u5ea6\u5c0f\u4e8e10kb\u7684\u6587\u4ef6<\/p>\n find.-size+10k<\/p>\n 2<\/p>\n locate\u67e5\u627e\u6587\u4ef6<\/p>\n <\/p>\n