\u6240\u4ee5\uff0c\u6b63\u5982\u5f00\u5934\u63d0\u5230\u7684\u9762\u8bd5\u9898\uff0c\u8981\u641c\u7d22 atime \u8d85\u8fc7\u4e00\u5e74\u7684\u6587\u4ef6\uff0c\u6211\u4eec\u53ef\u4ee5\u7f16\u5199\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n
find . -type f -atime +365\r\n<\/pre>\n\u5982\u679c\u6211\u4eec\u9700\u8981\u67e5\u627e mtime \u6b63\u597d\u662f 5 \u5929\u524d\u7684\u6587\u4ef6\uff0c\u8bf7\u4e0d\u8981\u5305\u542b +\uff0c\u56e0\u4e3a\u5b83\u7684\u610f\u601d\u662f\u201c\u5927\u4e8e\u201d\u3002<\/p>\n
find . -type f -mtime 5\r\n<\/pre>\n\u663e\u7136\uff0c+ \u8868\u793a\u201c\u5927\u4e8e\u201d\uff0c- \u8868\u793a\u201c\u5c0f\u4e8e\u201d\u3002\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u641c\u7d22 ctime \u5728 5~10 \u5929\u524d\u7684\u6587\u4ef6\uff1a<\/p>\n
find . -type f -ctime +5 -ctime -10\r\n<\/pre>\n\u6309\u5927\u5c0f\u67e5\u627e\u6587\u4ef6<\/strong><\/span><\/div>\n-size\u9009\u9879\u4f7f\u6211\u4eec\u80fd\u591f\u6309\u6307\u5b9a\u5927\u5c0f\u67e5\u627e\u6587\u4ef6\u3002\u6211\u4eec\u53ef\u4ee5\u5c06\u5176\u8ba1\u91cf\u5355\u4f4d\u6307\u5b9a\u4e3a\u4ee5\u4e0b\u7ea6\u5b9a\uff1a<\/p>\n
b\uff1a512 \u5b57\u8282\u5757\uff08\u9ed8\u8ba4\uff09\r\nc\uff1a\u5b57\u8282\r\nw\uff1a\u53cc\u5b57\u8282\u5b57\r\nk\uff1aKB\r\nM\uff1aMB\r\nG\uff1aGB\r\n<\/pre>\n\u7c7b\u4f3c\u4e8e\u6309\u65f6\u95f4\u6233\u67e5\u627e\u6587\u4ef6\uff0c+ \u8868\u793a\u201c\u5927\u4e8e\u201d\uff0c- \u8868\u793a\u201c\u5c0f\u4e8e\u201d\u3002\u4f8b\u5982\uff0c\u8981\u67e5\u627e\u5927\u5c0f\u4e3a 10 MB ~ 1 GB \u7684\u6587\u4ef6\uff1a<\/p>\n
find . -type f -size +10M -size -1G\r\n<\/pre>\n\u6309\u6743\u9650\u67e5\u627e\u6587\u4ef6<\/strong><\/span><\/div>\n\u5408\u7406\u63a7\u5236\u6587\u4ef6\u7684\u6743\u9650\u662f Linux \u7ba1\u7406\u5458\u7684\u4e00\u9879\u91cd\u8981\u4efb\u52a1\u3002find \u547d\u4ee4\u7684 -perm \u9009\u9879\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u6309\u6307\u5b9a\u6743\u9650\u67e5\u627e\u6587\u4ef6\uff1a<\/p>\n
find . -type f -perm 777\r\n<\/pre>\n\u4f8b\u5982\uff0c\u4e0a\u9762\u7684\u547d\u4ee4\u4f1a\u641c\u7d22\u6240\u6709\u5177\u6709 777 \u6743\u9650\u7684\u6587\u4ef6\uff0c\u8fd9\u610f\u5473\u7740\u4e00\u4e2a\u6587\u4ef6\u5bf9\u5176\u6301\u6709\u8005\u3001\u7ec4\u548c\u6240\u6709\u7528\u6237\u5177\u6709\u6240\u6709\u7684\u8bfb\u3001\u5199\u548c\u53ef\u6267\u884c\u6743\u9650\u3002\u6309\u6240\u6709\u6743\u67e5\u627e\u6587\u4ef6
\n\u8fd9\u4e2a\u4efb\u52a1\u5f88\u7b80\u5355\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 -user \u9009\u9879\u6307\u5b9a\u7528\u6237\u540d\u3002\u4f8b\u5982\uff0c\u4ee5\u4e0b\u547d\u4ee4\u5c06\u67e5\u627e\u6240\u6709\u5c5e\u4e8e yang \u7684\u6587\u4ef6\uff1a<\/p>\n
find -type f -user yang\r\n<\/pre>\n\u5728\u627e\u5230\u6587\u4ef6\u540e\u6267\u884c\u547d\u4ee4<\/strong><\/span><\/div>\n\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5e0c\u671b\u5728\u627e\u5230\u6211\u4eec\u9700\u8981\u7684\u6587\u4ef6\u540e\u8fdb\u884c\u540e\u7eed\u64cd\u4f5c\u3002\u4f8b\u5982\u5c06\u5176\u5220\u9664\uff0c\u6216\u68c0\u67e5\u5b83\u4eec\u7684\u8be6\u7ec6\u4fe1\u606f\u7b49\u7b49\u3002-exec \u547d\u4ee4\u4f7f\u8fd9\u4e9b\u6240\u6709\u4e8b\u60c5\u53d8\u5f97\u66f4\u52a0\u5bb9\u6613\u3002
\n\u73b0\u5728\uff0c\u8981\u4e86\u89e3\u5982\u4f55\u4f7f\u7528\u5b83\uff0c\u8ba9\u6211\u4eec\u56de\u5230\u4e4b\u524d\u63d0\u5230\u7684\u9762\u8bd5\u95ee\u9898\uff1a<\/p>\n
find . -type f -atime +365 -exec rm -rf {} \\;\r\n<\/pre>\n\u4e0a\u8ff0\u547d\u4ee4\u5728 -exec \u9009\u9879\u540e\u662f rm -rf\uff0c\u5176\u7528\u4e8e\u5220\u9664\u6587\u4ef6\u3002{} \u662f\u7528\u4e8e\u67e5\u627e\u7ed3\u679c\u7684\u5360\u4f4d\u7b26\u3002
\n\u6ce8\u610f\uff1a\u5360\u4f4d\u7b26 {} \u975e\u5e38\u91cd\u8981\uff0c\u5c24\u5176\u662f\u5728\u60a8\u60f3\u5220\u9664\u6587\u4ef6\u65f6\u3002\u56e0\u4e3a\uff0c\u5982\u679c\u60a8\u4e0d\u4f7f\u7528\u5b83\uff0c\u8be5\u547d\u4ee4\u5c06\u5bf9\u6240\u6709\u6587\u4ef6\u6267\u884c\uff08\u800c\u4e0d\u662f\u60a8\u521a\u521a\u901a\u8fc7 find \u547d\u4ee4\u627e\u5230\u7684\u6587\u4ef6\uff09\u3002
\n\u505a\u4e00\u4e2a\u5c1d\u8bd5\uff0c\u8bf7\u5728\u7ec8\u7aef\u4e0a\u6267\u884c\u4ee5\u4e0b\u4e24\u4e2a\u547d\u4ee4\uff0c\u5e76\u68c0\u67e5\u5b83\u4eec\u7684\u7ed3\u679c\u6709\u4f55\u4e0d\u540c\uff1a
\n\u4e00\u4e2a\u4f7f\u7528\u5360\u4f4d\u7b26\uff1a<\/p>\n
find . -type f -atime +5 -exec ls {} \\;\r\n<\/pre>\n\u53e6\u4e00\u4e2a\u4e0d\u4f7f\u7528\uff1a<\/p>\n
find . -type f -atime +5 -exec ls \\;\r\n<\/pre>\n-exec \u9009\u9879\u540e\u9762\u7684\u547d\u4ee4\u5fc5\u987b\u4ee5\u5206\u53f7\uff08;\uff09\u7ed3\u675f\u3002\u4f17\u6240\u5468\u77e5\uff0c\u8f6c\u4e49\u5b57\u7b26\u7528\u4e8e\u53bb\u9664\u5355\u4e2a\u5b57\u7b26\u7684\u7279\u6b8a\u542b\u4e49\u3002\u5728 Linux \u4e2d\uff0c\u53cd\u659c\u6760\\\u7528\u4f5c\u8f6c\u4e49\u5b57\u7b26\u3002\u6240\u4ee5\u6211\u4eec\u5c06\u5b83\u7528\u4e8e\u5206\u53f7\u5b57\u7b26\u3002<\/p>\n
\u603b\u7ed3<\/strong><\/div>\n\u770b\u5b8c find \u547d\u4ee4\u7684 7 \u79cd\u7528\u6cd5\u540e\uff0c\u5f00\u59cb\u63d0\u5230\u7684\u9762\u8bd5\u9898\u73b0\u5728\u597d\u50cf\u5f88\u5bb9\u6613\u89e3\u51b3\u4e86\u3002\u4f60\u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u5199\u4e0b\u5b83\u7684\u7b54\u6848\u5e76\u5c06\u5176\u89e3\u91ca\u6e05\u695a\u5417\uff1f<\/p>\n
find . -type f -atime +365 -exec rm -rf {} \\;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"\u5bf9\u4e8e\u6280\u672f\u9762\u8bd5\uff0c\u5b83\u4e5f\u662f\u4e00\u4e2a\u70ed\u95e8\u8bdd\u9898\u3002\u8ba9\u6211\u4eec\u770b\u4e00\u9053\u771f\u9898\uff1a \u5982\u679c\u4f60\u7684 Linux \u670d\u52a1\u5668\u4e0a\u6709\u4e00\u4e2a\u540d\u4e3a logs \u7684\u76ee […]<\/p>\n","protected":false},"author":643,"featured_media":255229,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-255223","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/255223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=255223"}],"version-history":[{"count":6,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/255223\/revisions"}],"predecessor-version":[{"id":255509,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/255223\/revisions\/255509"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/255229"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=255223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=255223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=255223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}