{"id":16149,"date":"2023-10-15T20:01:41","date_gmt":"2023-10-15T12:01:41","guid":{"rendered":"https:\/\/www.linuxcool.com\/lxtxdwjsjsxs"},"modified":"2023-10-15T20:01:41","modified_gmt":"2023-10-15T12:01:41","slug":"lxtxdwjsjsxs","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/lxtxdwjsjsxs","title":{"rendered":"Linux\u7cfb\u7edf\u4e0b\u7684\u6587\u4ef6\u65f6\u95f4\u5c5e\u6027\u662f\u600e\u4e48\u4fee\u6539\u7684\u5462\uff1f"},"content":{"rendered":"<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6211\u4eec\u5e73\u5e38IT\u8fd0\u7ef4\u65f6linux cp\uff0c\u5f80\u5f80\u4f1a\u987b\u8981\u53bb\u67e5\u770b<a style='color:#0000CC;font-size:16px' href='https:\/\/www.linuxprobe.com\/' target='_blank' rel=\"noopener\">Linux<\/a><a style='color:#0000CC;font-size:16px' href='https:\/\/www.linuxdown.com\/' target='_blank' rel=\"noopener\">\u7cfb\u7edf<\/a>\u4e0b\u6587\u4ef6\u7684\u4e00\u4e9b\u65f6\u95f4\u5c5e\u6027\uff0c\u4f8b\u5982\u67e5\u770b\u4e00\u4e2a\u5e94\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u7684\u66f4\u6539\u65f6\u95f4\uff0c\u7528\u4e8e\u521d\u6b65\u5224\u5b9a\u8be5\u6587\u4ef6\u662f\u5426\u6709\u88ab\u7be1\u6539\u8fc7\u3002\u8fd9\u4e48\u672c\u6587\u5c31\u9488\u5bf9Linux\u7cfb\u7edf\u4e0b\u7684\u6587\u4ef6\u7684\u65f6\u95f4\u5c5e\u6027\u6765\u505a\u4e00\u4e2a\u4ecb\u7ecd\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:500px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/10\/1697371299848_0.jpg' alt='linux\u547d\u4ee4\u884c\u521b\u5efa\u6587\u4ef6\u5939_linux\u7528\u547d\u4ee4\u521b\u5efa\u6587\u4ef6\u5939_linux\u521b\u5efa\u6587\u4ef6\u5939 \u547d\u4ee4' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>Linux\u6587\u4ef6\u65f6\u95f4\u5c5e\u6027<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5728Linux\u7cfb\u7edf\u4e0b\uff0c\u6587\u4ef6\u7684\u65f6\u95f4\u5c5e\u6027\u4e3b\u8981\u5206\u4e3a\u4e09\u79cd\uff1a\u8bbf\u95ee\u65f6\u95f4atime\u3001\u4fee\u6539\u65f6\u95f4mtime\u3001\u72b6\u6001\u6539\u52a8\u65f6\u95f4ctime\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6211\u4eec\u65b0\u5efa\u4e00\u4e2a\u201ctest\u201d\u6587\u4ef6\u5e76\u5199\u5165\u4e00\u4e9b\u5185\u5bb9\uff0c\u4e4b\u540e\u53ef\u901a\u8fc7stat<a style='color:#0000CC;font-size:16px' href='https:\/\/www.linuxcool.com\/' target='_blank' rel=\"noopener\">\u547d\u4ee4<\/a>\u67e5\u770b\u6587\u4ef6\u7684\u4e09\u4e2a\u65f6\u95f4\uff0c\u521a\u521b\u5efa\uff0c\u624d\u80fd\u53d1\u89c9\u8fd9\u4e09\u4e2a\u65f6\u95f4\u662f\u4e00\u6837\u7684\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>atime<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>atime\u662fAccessTime\u7684\u7f29\u5199<strong>linux\u521b\u5efa\u6587\u4ef6\u5939 \u547d\u4ee4<\/strong>\uff0c\u663e\u793a\u7684\u662f\u6587\u4ef6\u4e2d\u7684\u6570\u636e\u6700\u540e\u88ab\u8bbf\u95ee\u7684\u65f6\u95f4\uff0c\u8bfb\u4e00\u6b21\u8fd9\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9linux\u6559\u7a0b\uff0c\u8fd9\u4e2a\u65f6\u95f4\u624d\u4f1a\u66f4\u65b0\uff0c\u6bd4\u5982\u6211\u4eec\u4f7f\u7528cat\u3001more\u3001less\u7b49\u547d\u4ee4\u67e5\u770b\u6587\u4ef6\u7684\u5185\u5bb9\u65f6\uff0c\u6587\u4ef6\u7684\u8bbf\u95ee\u65f6\u95f4\u624d\u4f1a\u88ab\u66f4\u65b0\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:500px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/10\/1697371299848_2.jpg' alt='linux\u547d\u4ee4\u884c\u521b\u5efa\u6587\u4ef6\u5939_linux\u7528\u547d\u4ee4\u521b\u5efa\u6587\u4ef6\u5939_linux\u521b\u5efa\u6587\u4ef6\u5939 \u547d\u4ee4' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>mtime<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>mtime\u662fModifyTime\u7684\u7f29\u5199\uff0c\u663e\u793a\u7684\u662f\u6587\u4ef6\u7684\u5185\u5bb9\u88ab\u6539\u53d8\u65f6\u7684\u6700\u540e\u65f6\u95f4\uff0c\u6bd4\u5982\u6211\u4eec\u7528echo\u3001vi\u7b49\u6307\u4ee4\u5411\u6587\u4ef6\u5199\u6570\u636e\u8fd9\u4e2a\u65f6\u95f4\u624d\u4f1a\u6539\u53d8\uff0c\u201cls-l\u201d\u547d\u4ee4\u5217\u4e3e\u7684\u65f6\u95f4\u5c31\u662f\u8fd9\u4e2a\u65f6\u95f4\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:500px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/10\/1697371299848_3.jpg' alt='linux\u547d\u4ee4\u884c\u521b\u5efa\u6587\u4ef6\u5939_linux\u521b\u5efa\u6587\u4ef6\u5939 \u547d\u4ee4_linux\u7528\u547d\u4ee4\u521b\u5efa\u6587\u4ef6\u5939' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>ctime<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>ctime\u662fChangeTime\u7684\u7f29\u5199\uff0c\u663e\u793a\u7684\u662f\u6587\u4ef6\u7684\u5927\u5c0f\u3001\u5185\u5bb9\u3001\u6743\u9650\u3001\u62e5\u6709\u8005\u3001\u6240\u5c5e\u7684\u7ec4\u3001\u94fe\u63a5\u6570\u7b49\u53d1\u751f\u6539\u53d8\u65f6\u7684\u65f6\u95f4\uff0c\u5f53\u6587\u4ef6\u7684\u8fd9\u79cd\u5c5e\u6027\u88ab\u6539\u53d8\u662f\u90fd\u4f1a\u4fee\u6539\u8fd9\u4e2a\u65f6\u95f4\uff0c\u901a\u8fc7chmod\u3001chown\u547d\u4ee4\u66f4\u6539\u4e00\u6b21\u6587\u4ef6\u5c5e\u6027\uff0c\u8fd9\u4e2a\u65f6\u95f4\u90fd\u4f1a\u66f4\u65b0\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:500px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/10\/1697371299848_4.jpg' alt='linux\u547d\u4ee4\u884c\u521b\u5efa\u6587\u4ef6\u5939_linux\u7528\u547d\u4ee4\u521b\u5efa\u6587\u4ef6\u5939_linux\u521b\u5efa\u6587\u4ef6\u5939 \u547d\u4ee4' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6587\u4ef6\u521b\u5efa\u65f6\u95f4<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u597d\u591a\u4eba\u8bef\u5c06linux\u7cfb\u7edf\u4e0a\u6587\u4ef6\u7684ctime\u5bf9\u6807\u6210windows\u7cfb\u7edf\u4e0a\u7684\u521b\u5efa\u65f6\u95f4\uff0c\u8fd9\u662f\u4e0d\u5bf9\u7684\uff0cctime\u91cc\u7684\u5b57\u6bcdc\u662fchange\u7684\u7b80\u5199\u800c\u975ecreate\u7684\u7b80\u5199\u3002\u5728Linux\u4e0b\u6ca1\u6709\u521b\u5efa\u65f6\u95f4\u7684\u6982\u5ff5\uff0c\u4e5f\u5c31\u662f\u4e0d\u80fd\u5426\u6653\u5f97\u6587\u4ef6\u7684\u6784\u5efa\u65f6\u95f4\uff0c\u5173\u4e8elinux\u7cfb\u7edf\u4e0a\u4e3a\u4f55\u4e0d\u8bb0\u5f55\u6587\u4ef6\u7684\u521b\u5efa\u65f6\u95f4\uff0c\u6709\u597d\u591a\u7684\u8ba8\u8bba\uff0c\u6709\u4eba\u89c9\u5f97\u6587\u4ef6\u7684\u521b\u5efa\u65f6\u95f4\u5bf9\u4e8e\u5927\u591a\u6570\u4eba\u6765\u8bf4\u662f\u65e0\u7528\u7684\uff0c\u53ef\u4ee5\u7528\u5176\u4ed6\u6765\u53d6\u4ee3\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u867d\u7136\u7531\u4e8e\u4e0d\u597d\u5224\u5b9a\u6587\u4ef6\u662f\u5426\u88ab\u6539\u8fc7\u3001\u8bfb\u8fc7\u3001\u5176\u72b6\u6001\u662f\u5426\u53d8\u8fc7\uff0c\u6240\u4ee5\u5224\u5b9a\u6587\u4ef6\u7684\u6784\u5efa\u65f6\u95f4\u57fa\u672c\u4e0a\u4e3a\u4e0d\u5927\u53ef\u80fd\u3002\u800c\u4e14\u5047\u5982\u4f60\u7684Linux\u6587\u4ef6\u7cfb\u7edf\u7684\u683c\u5f0f\u662fext4\uff0c\u6587\u4ef6\u521b\u5efa\u65f6\u95f4\u662f\u4f1a\u50a8\u5b58\u5728ext4\u6587\u4ef6\u7cfb\u7edf\u7684inode\u4e2d\uff0c\u6240\u4ee5ext4\u6587\u4ef6\u7cfb\u7edf\u4f7f\u7528\u7279\u6b8a\u6280\u5de7\u8fd8\u662f\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u521b\u5efa\u65f6\u95f4\u7684\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>1.\u901a\u8fc7\u201cdf-T\u201d\u547d\u4ee4\u67e5\u770bLinux\u6587\u4ef6\u7cfb\u7edf\u662f\u5426\u4e3aext4\u683c\u5f0f\uff0c\u4f46\u662f\u67e5\u770b\u6587\u4ef6\u6240\u5728c\u76d8\u8def\u5f84\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>2.\u901a\u8fc7\u201cls-i\u201d\u547d\u4ee4\u83b7\u53d6\u5230\u6587\u4ef6\u7684inode\u503c\uff0c\u5176\u5b9estat\u547d\u4ee4\u4e5f\u53ef\u4ee5\u67e5\u770b\u5230\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:500px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/10\/1697371299848_5.jpg' alt='linux\u547d\u4ee4\u884c\u521b\u5efa\u6587\u4ef6\u5939_linux\u7528\u547d\u4ee4\u521b\u5efa\u6587\u4ef6\u5939_linux\u521b\u5efa\u6587\u4ef6\u5939 \u547d\u4ee4' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>3.\u901a\u8fc7\u201cdebugfs-R\u2018stat\u2019\u78c1\u76d8\u8def\u5f84\u201d\u547d\u4ee4\u4fbf\u53ef\u67e5\u770b\u6587\u4ef6\u521b\u5efa\u65f6\u95f4cttime\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:500px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/10\/1697371299848_6.jpg' alt='linux\u7528\u547d\u4ee4\u521b\u5efa\u6587\u4ef6\u5939_linux\u521b\u5efa\u6587\u4ef6\u5939 \u547d\u4ee4_linux\u547d\u4ee4\u884c\u521b\u5efa\u6587\u4ef6\u5939' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>Find\u547d\u4ee4\u501f\u52a9\u65f6\u95f4\u5c5e\u6027\u5e38\u89c1\u64cd\u4f5c<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>Linux\u7cfb\u7edf\u4e2dfind\u547d\u4ee4\u62ff\u6765\u5728\u6307\u5b9a\u76ee\u5f55\u4e0b\u67e5\u627e\u6587\u4ef6\uff0c\u8fd9\u4e48\u6211\u4eec\u5c31\u53ef\u4ee5\u501f\u52a9\u8fd9\u4e09\u4e2a\u65f6\u95f4\u5c5e\u6027\u505a\u4e00\u4e9b\u65e5\u5e38\u8fd0\u7ef4\u64cd\u4f5c\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6bd4\u5982\u6211\u4eec\u987b\u8981\u5c06\u6307\u5b9a\u76ee\u5f55\u4e0b\u6240\u6709\u8fd1\u676520\u5929\u5185\u6709\u66f4\u65b0\u8fc7\u7684\u6587\u4ef6\u90fd\u5217\u4e0b\u6765\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>find \/data -ctime -20<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u67e5\u627e\u6307\u5b9a\u76ee\u5f55\u4e0b\u6240\u6709\u4fee\u6539\u65f6\u95f4\u57287\u5929\u66fe\u7ecf\u5e76\u4ee5log\u7ed3\u5c3e\u7684\u5c0f\u4e8e1M\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:500px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/10\/1697371299848_7.png' alt='linux\u547d\u4ee4\u884c\u521b\u5efa\u6587\u4ef6\u5939_linux\u521b\u5efa\u6587\u4ef6\u5939 \u547d\u4ee4_linux\u7528\u547d\u4ee4\u521b\u5efa\u6587\u4ef6\u5939' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>find \/data -type f -name \"*.log\" -mtime +7 -size +1M<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u901a\u8fc7find\u547d\u4ee4\u5c06\u8fd9\u79cd\u6587\u4ef6\u67e5\u627e\u4e0b\u6765\u540e\uff0c\u518d\u53ef\u4ee5\u7ed3\u5408xargs\u6216\u5219exec\u547d\u4ee4\u505a\u8fdb\u4e00\u6b65\u7684\u64cd\u4f5c\uff0c\u4f8b\u5982\u60f3\u628a\u4e0a\u8ff0\u67e5\u627e\u4e0b\u6765\u7684\u6587\u4ef6\u5220\u9664\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>find \/data -type f -name \"*.log\" -mtime +7 -size +1M | xargs rm -f<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6216<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>find \/data -type f -name \"*.log\" -mtime +7 -size +1M -exec rm -f {} ;<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5c06\u4e0a\u8ff0\u67e5\u627e\u4e0b\u6765\u7684\u6587\u4ef6\u8054\u901a\u5230\u6307\u5b9a\u76ee\u5f55\u4e0b\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>find \/data -type f -name \"*.log\" -mtime +7 -size +1M -exec mv {} \/tmp\/ ;<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4ee5\u4e0a\u5c31\u662f\u5173\u4e8eLinux\u7cfb\u7edf\u6587\u4ef6\u65f6\u95f4\u5c5e\u6027\u7684\u4e00\u4e9b\u4ecb\u7ecd\u4e86<strong>linux\u521b\u5efa\u6587\u4ef6\u5939 \u547d\u4ee4<\/strong>\uff0c\u5982\u6709\u95ee\u9898\u6b22\u8fce\u4e00\u8d77\u5b66\u4e60\u4ea4\u6d41\u54af~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4eec\u65b0\u5efa\u4e00\u4e2a\u201ctest\u201d\u6587\u4ef6\u5e76\u5199\u5165\u4e00\u4e9b\u5185\u5bb9\uff0c\u7136\u540e\u53ef\u901a\u8fc7stat\u547d\u4ee4\u67e5\u770b\u6587\u4ef6\u7684\u4e09\u4e2a\u65f6\u95f4\uff0c\u521a\u521b\u5efa\uff0c\u80fd\u591f\u53d1\u73b0\u8fd9\u4e09\u4e2a\u65f6\u95f4\u662f\u4e00\u6837\u7684\u3002-T\u201d\u547d\u4ee4\u67e5\u770bLinux\u6587\u4ef6\u7cfb\u7edf\u662f\u5426\u4e3aext4\u683c\u5f0f\uff0c\u5e76\u4e14\u67e5\u770b\u6587\u4ef6\u6240\u5728\u78c1\u76d8\u8def\u5f84\u3002\u78c1\u76d8\u8def\u5f84\u201d\u547d\u4ee4\u4fbf\u53ef\u67e5\u770b\u6587\u4ef6\u521b\u5efa\u65f6\u95f4cttime\u3002<\/p>\n","protected":false},"author":1,"featured_media":16150,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[921,23,920],"class_list":["post-16149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledge","tag-c-15","tag-lxt","tag-wjsx"],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/16149","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=16149"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/16149\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media\/16150"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=16149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=16149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=16149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}