{"id":15720,"date":"2023-08-20T20:06:43","date_gmt":"2023-08-20T12:06:43","guid":{"rendered":"https:\/\/www.linuxcool.com\/lmlyfxj"},"modified":"2023-08-20T20:06:43","modified_gmt":"2023-08-20T12:06:43","slug":"lmlyfxj","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/lmlyfxj","title":{"rendered":"Linux Find\u547d\u4ee4\u8bed\u6cd5\u8be6\u89e3"},"content":{"rendered":"<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><a style='color:#0000CC' href='https:\/\/www.linuxprobe.com\/' target='_blank' rel=\"noopener\">Linux<\/a>\u64cd\u4f5c<a style='color:#0000CC' href='https:\/\/www.linuxdown.com\/' target='_blank' rel=\"noopener\">\u7cfb\u7edf<\/a>\u4e2d\u7684Find<a style='color:#0000CC' href='https:\/\/www.linuxcool.com\/' target='_blank' rel=\"noopener\">\u547d\u4ee4<\/a>\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u7684\u6587\u4ef6\u641c\u7d22\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u5b9a\u4f4d\u5230\u6307\u5b9a\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u548c\u6587\u4ef6\u5939\u3002\u901a\u8fc7\u7075\u6d3b\u591a\u53d8\u7684\u547d\u4ee4\u8bed\u6cd5\uff0cFind\u547d\u4ee4\u80fd\u591f\u6ee1\u8db3\u7528\u6237\u5404\u79cd\u4e0d\u540c\u7684\u641c\u7d22\u9700\u6c42\u3002\u4e0b\u9762\u662f\u5173\u4e8eLinux Find\u547d\u4ee4\u8bed\u6cd5\u7684\u8be6\u7ec6\u4ecb\u7ecd\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4e00\u3001\u57fa\u672c\u8bed\u6cd5<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4f7f\u7528Find\u547d\u4ee4\u65f6ubuntu linux\uff0c\u9700\u8981\u6307\u5b9a\u8981\u641c\u7d22\u7684\u76ee\u5f55\u8def\u5f84\uff0c\u5e76\u4e14\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u641c\u7d22\u6761\u4ef6\u3002\u57fa\u672c\u7684Find\u547d\u4ee4\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\nfind [path][option][expression]\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5176\u4e2d\uff0c`path`\u8868\u793a\u8981\u641c\u7d22\u7684\u8def\u5f84\uff0c\u53ef\u4ee5\u662f\u7edd\u5bf9\u8def\u5f84\u6216\u76f8\u5bf9\u8def\u5f84\uff1b`option`\u8868\u793a\u9009\u9879\u53c2\u6570\uff0c\u7528\u4e8e\u8fdb\u4e00\u6b65\u63a7\u5236\u641c\u7d22\uff1b`expression`\u8868\u793a\u8868\u8fbe\u5f0f\u53c2\u6570\uff0c\u7528\u4e8e\u6307\u5b9a\u641c\u7d22\u6761\u4ef6\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4e8c\u3001\u5e38\u7528\u9009\u9879<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>1.`-name`\uff1a\u6309\u7167\u6587\u4ef6\u540d\u8fdb\u884c\u5339\u914d\u641c\u7d22\uff1b<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>2.`-type`\uff1a\u6309\u7167\u6587\u4ef6\u7c7b\u578b\u8fdb\u884c\u5339\u914d\u641c\u7d22\uff1b<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>3.`-size`\uff1a\u6309\u7167\u6587\u4ef6\u5927\u5c0f\u8fdb\u884c\u5339\u914d\u641c\u7d22\uff1b<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>4.`-mtime`\uff1a\u6309\u7167\u6587\u4ef6\u4fee\u6539\u65f6\u95f4\u8fdb\u884c\u5339\u914d\u641c\u7d22\uff1b<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:350px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/08\/1692533202477_1.png' alt='linux\u4e0b\u7684find\u547d\u4ee4_linux find\u547d\u4ee4\u8bed\u6cd5_linux\u547d\u4ee4find' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>5.`-user`\uff1a\u6309\u7167\u6587\u4ef6\u6240\u6709\u8005\u8fdb\u884c\u5339\u914d\u641c\u7d22\uff1b<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>6.`-group`\uff1a\u6309\u7167\u6587\u4ef6\u6240\u5c5e\u7ec4\u8fdb\u884c\u5339\u914d\u641c\u7d22\uff1b<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>7.`-perm`\uff1a\u6309\u7167\u6587\u4ef6\u6743\u9650\u8fdb\u884c\u5339\u914d\u641c\u7d22\uff1b<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>8.`-exec`\uff1a\u5bf9\u641c\u7d22\u7ed3\u679c\u6267\u884c\u7279\u5b9a\u64cd\u4f5c\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4e09\u3001\u5b9e\u4f8b\u6f14\u793a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3Find\u547d\u4ee4\u7684\u4f7f\u7528<strong>linux find\u547d\u4ee4\u8bed\u6cd5<\/strong>\uff0c\u4ee5\u4e0b\u662f\u51e0\u4e2a\u5b9e\u9645\u573a\u666f\u4e0b\u7684\u793a\u4f8b\u6f14\u793a\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>1.\u641c\u7d22\u6307\u5b9a\u6587\u4ef6\u540d\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\nfind \/home -name &quot;test.txt&quot;\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u6761\u547d\u4ee4\u5c06\u5728`\/home`\u76ee\u5f55\u4e0b\u641c\u7d22\u6587\u4ef6\u540d\u4e3a`test.txt`\u7684\u6587\u4ef6\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>2.\u641c\u7d22\u6307\u5b9a\u7c7b\u578b\u7684\u6587\u4ef6\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\nfind \/var\/log -type f\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u6761\u547d\u4ee4\u5c06\u5728`\/var\/log`\u76ee\u5f55\u4e0b\u641c\u7d22\u6240\u6709\u7c7b\u578b\u4e3a\u6587\u4ef6\u7684\u9879\u76ee\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>3.\u641c\u7d22\u5927\u4e8e\u6307\u5b9a\u5927\u5c0f\u7684\u6587\u4ef6\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\nfind \/tmp -size +1M\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u6761\u547d\u4ee4\u5c06\u5728`\/tmp`\u76ee\u5f55\u4e0b\u641c\u7d22\u5927\u5c0f\u5927\u4e8e1MB\u7684\u6587\u4ef6\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:350px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/08\/1692533202477_3.png' alt='linux\u4e0b\u7684find\u547d\u4ee4_linux\u547d\u4ee4find_linux find\u547d\u4ee4\u8bed\u6cd5' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>4.\u641c\u7d22\u6700\u8fd1\u4fee\u6539\u8fc7\u7684\u6587\u4ef6\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\nfind \/etc -mtime -7\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u6761\u547d\u4ee4\u5c06\u5728`\/etc`\u76ee\u5f55\u4e0b\u641c\u7d22\u6700\u8fd17\u5929\u5185\u4fee\u6539\u8fc7\u7684\u6587\u4ef6\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u56db\u3001\u603b\u7ed3<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u901a\u8fc7\u4ee5\u4e0a\u5b9e\u4f8b\u6f14\u793a\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230Linux Find\u547d\u4ee4\u7684\u5f3a\u5927\u529f\u80fd\u548c\u7075\u6d3b\u6027\u3002\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5feb\u901f\u627e\u5230\u6307\u5b9a\u8def\u5f84\u4e0b\u7684\u6587\u4ef6\u767e\u5ea6\u7f51\u76d8LINUX\uff0c\u8fd8\u80fd\u6839\u636e\u5404\u79cd\u6761\u4ef6\u8fdb\u884c\u7cbe\u786e\u641c\u7d22\u3002\u638c\u63e1\u4e86Find\u547d\u4ee4\u7684\u8bed\u6cd5\u548c\u5e38\u7528\u9009\u9879<strong>linux find\u547d\u4ee4\u8bed\u6cd5<\/strong>\uff0c\u6211\u4eec\u80fd\u591f\u66f4\u9ad8\u6548\u5730\u7ba1\u7406\u548c\u64cd\u4f5cLinux\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Find\u547d\u4ee4\u8bed\u6cd5\u7684\u8be6\u7ec6\u4ecb\u7ecd\uff1a\u4e00\u3001\u57fa\u672c\u8bed\u6cd5\u57fa\u672c\u7684Find\u547d\u4ee4\u8bed\u6cd5\u5982\u4e0b\uff1a[path][option][expression]`-exec`\uff1a\u5bf9\u641c\u7d22\u7ed3\u679c\u6267\u884c\u7279\u5b9a\u64cd\u4f5c\u3002\u8fd9\u6761\u547d\u4ee4\u5c06\u5728`\/home`\u76ee\u5f55\u4e0b\u641c\u7d22\u6587\u4ef6\u540d\u4e3a`test.\u8fd9\u6761\u547d\u4ee4\u5c06\u5728`\/var\/log`\u76ee\u5f55\u4e0b\u641c\u7d22\u6240\u6709\u7c7b\u578b\u4e3a\u6587\u4ef6\u7684\u9879\u76ee\u3002\u638c\u63e1\u4e86Find\u547d\u4ee4\u7684\u8bed\u6cd5\u548c\u5e38\u7528\u9009\u9879\uff0c\u6211\u4eec\u80fd\u591f\u66f4\u9ad8\u6548\u5730\u7ba1\u7406\u548c\u64cd\u4f5cLinux\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\u3002<\/p>\n","protected":false},"author":1,"featured_media":15721,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[23],"class_list":["post-15720","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledge","tag-lxt"],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/15720","targetHints":{"allow":["GET"]}}],"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=15720"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/15720\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media\/15721"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=15720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=15720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=15720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}