{"id":69084,"date":"2024-03-04T06:14:12","date_gmt":"2024-03-03T22:14:12","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=69084"},"modified":"2024-03-04T06:14:12","modified_gmt":"2024-03-03T22:14:12","slug":"linux-del-files","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-del-files.html","title":{"rendered":"\u5728 Linux \u4e2d\u5220\u9664\u8d85\u5927\u6587\u4ef6\u7684\u6280\u5de7"},"content":{"rendered":"
<\/p>\n
\u901a\u5e38\uff0c\u8981\u5728 Linux \u7ec8\u7aef\u5220\u9664\u4e00\u4e2a\u6587\u4ef6\uff0c\u6211\u4eec\u4f7f\u7528 rm \u547d\u4ee4\uff08\u5220\u9664\u6587\u4ef6\uff09\u3001shred \u547d\u4ee4\uff08\u5b89\u5168\u5220\u9664\u6587\u4ef6\uff09\u3001wipe \u547d\u4ee4\uff08\u5b89\u5168\u64e6\u9664\u6587\u4ef6\uff09\u6216\u8005 secure-deletion \u5de5\u5177\u5305\uff08\u4e00\u4e2a\u5b89\u5168\u6587\u4ef6\u5220\u9664\u5de5\u5177\u96c6\u5408\uff09\u3002<\/p>\n
\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e0a\u8ff0\u4efb\u610f\u7684\u5de5\u5177\u6765\u5904\u7406\u76f8\u5bf9\u8f83\u5c0f\u7684\u6587\u4ef6\u3002\u5982\u679c\u6211\u4eec\u60f3\u8981\u5220\u9664\u8d85\u5927\u7684\u6587\u4ef6\/\u6587\u4ef6\u5939\uff0c\u6bd4\u5982\u5927\u6982 100-200GB\uff0c\u5728\u5220\u9664\u6587\u4ef6\uff08I\/O \u8c03\u5ea6\uff09\u6240\u82b1\u8d39\u7684\u65f6\u95f4\u4ee5\u53ca RAM \u5360\u7528\u91cf\u65b9\u9762\uff0c\u5c31\u6ca1\u6709\u4f60\u60f3\u7684\u90a3\u4e48\u7b80\u5355\u3002<\/p>\n
\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u4f1a\u89e3\u91ca\u5982\u4f55\u5728 Linux \u4e2d\u6709\u6548\u7387\u5e76\u53ef\u9760\u5730\u5220\u9664\u5927\u6587\u4ef6\/\u6587\u4ef6\u5939\u3002<\/p>\n
\u6211\u4eec\u7684\u4e3b\u8981\u76ee\u6807\u662f\u4f7f\u7528\u4e00\u79cd\u4e0d\u4f1a\u5728\u5220\u9664\u5927\u6587\u4ef6\u65f6\u62d6\u6162\u7cfb\u7edf\u7684\u6280\u672f\uff0c\u5408\u7406\u5730\u5360\u7528 I\/O\u3002\u6211\u4eec\u53ef\u4ee5\u7528 ionice \u547d\u4ee4\u5b9e\u73b0\u8fd9\u4e2a\u76ee\u6807\u3002<\/p>\n
ionice \u662f\u4e00\u4e2a\u53ef\u4ee5\u5bf9\u53e6\u4e00\u4e2a\u7a0b\u5e8f\u8bbe\u7f6e\u6216\u83b7\u53d6 I\/O \u8c03\u5ea6\u7ea7\u522b\u548c\u4f18\u5148\u7ea7\u7684\u6709\u7528\u7a0b\u5e8f\u3002\u5982\u679c\u6ca1\u6709\u7ed9\u51fa\u53c2\u6570\u6216\u8005\u53ea\u6709 -p<\/span> \u53c2\u6570\uff0c\u90a3\u4e48 ionice \u5c06\u4f1a\u67e5\u8be2\u8be5\u8fdb\u7a0b\u7684\u5f53\u524d\u7684 I\/O \u8c03\u5ea6\u7ea7\u522b\u4ee5\u53ca\u4f18\u5148\u7ea7\u3002<\/p>\n \u5982\u679c\u6211\u4eec\u7ed9\u51fa\u547d\u4ee4\u540d\u79f0\uff0c\u5982rm\u547d\u4ee4\uff0c\u5b83\u5c06\u4f7f\u7528\u7ed9\u5b9a\u7684\u53c2\u6570\u8fd0\u884c\u6b64\u547d\u4ee4\u3002\u8981\u83b7\u53d6\u6216\u8bbe\u7f6e\u8c03\u5ea6\u53c2\u6570\uff0c\u8bf7\u6307\u5b9a[\u8fdb\u7a0b\u7684 PID]\uff0c\u5982\u4e0b\uff1a<\/p>\n \u8981\u6307\u5b9a\u540d\u5b57\u6216\u8005\u8c03\u5ea6\u7684\u6570\u5b57\uff0c\u4f7f\u7528\uff080 \u8868\u793a\u65e0\u30011 \u8868\u793a\u5b9e\u65f6\u30012 \u8868\u793a\u5c3d\u529b\u30013 \u8868\u793a\u7a7a\u95f2\uff09\u4e0b\u9762\u7684\u547d\u4ee4\u3002<\/p>\n \u4ee5\u4e0b\u547d\u4ee4\u8868\u793arm\u4f1a\u5c5e\u4e8e\u7a7a\u95f2 I\/O \u7ea7\u522b\uff0c\u5e76\u4e14\u53ea\u5728\u5176\u4ed6\u8fdb\u7a0b\u4e0d\u4f7f\u7528\u7684\u65f6\u5019\u4f7f\u7528 I\/O\uff1a<\/p>\n \u5982\u679c\u7cfb\u7edf\u4e2d\u6ca1\u6709\u5f88\u591a\u7a7a\u95f2\u65f6\u95f4\uff0c\u90a3\u4e48\u6211\u4eec\u5e0c\u671b\u4f7f\u7528\u5c3d\u529b\u8c03\u5ea6\u7ea7\u522b\uff0c\u5e76\u4e14\u4f7f\u7528\u4f4e\u4f18\u5148\u7ea7\uff1a<\/p>\n \u6ce8\u610f\uff1a\u8981\u4f7f\u7528\u5b89\u5168\u7684\u65b9\u6cd5\u5220\u9664\u5927\u6587\u4ef6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5148\u524d\u63d0\u5230\u7684shred\u3001wipe\u4ee5\u53ca secure-deletion \u5de5\u5177\u5305\u4e2d\u7684\u4e0d\u540c\u5de5\u5177\uff0c\u800c\u4e0d\u662frm\u547d\u4ee4\u3002<\/p>\n \u8981\u83b7\u53d6\u66f4\u591a\u4fe1\u606f\uff0c\u67e5\u9605ionice\u7684\u624b\u518c\u9875\uff1a<\/p>\n \u5c31\u662f\u8fd9\u6837\u4e86\uff01\u4f60\u8111\u6d77\u91cc\u8fd8\u6709\u5176\u4ed6\u7684\u65b9\u6cd5\u4e48\uff1f\u5728\u8bc4\u8bba\u680f\u4e2d\u4e0e\u6211\u4eec\u5206\u4eab\u3002<\/p>\n \u4f5c\u8005\u7b80\u4ecb\uff1a<\/p>\n Aaron Kili \u662f Linux \u548c F.O.S.S \u7231\u597d\u8005\uff0c\u5c06\u6765\u7684 Linux \u7cfb\u7edf\u7ba1\u7406\u5458\u548c\u7f51\u7edc\u5f00\u53d1\u4eba\u5458\uff0c\u76ee\u524d\u662f TecMint \u7684\u5185\u5bb9\u521b\u4f5c\u8005\uff0c\u4ed6\u559c\u6b22\u7528\u7535\u8111\u5de5\u4f5c\uff0c\u5e76\u575a\u4fe1\u5206\u4eab\u77e5\u8bc6\u3002<\/p>\n via: https:\/\/www.tecmint.com\/delete-huge-files-in-linux\/<\/a><\/p>\n \u4f5c\u8005\uff1aAaron Kili<\/a> \u8bd1\u8005\uff1ageekpi<\/a> \u6821\u5bf9\uff1awxy<\/a><\/p>\n \u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n \u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8537-1.html<\/a><\/p>\n# ionice -p PID\r\n<\/pre>\n
---- Deleting Huge Files in Linux -----\r\n# ionice -c 3 rm \/var\/logs\/syslog\r\n# ionice -c 3 rm -rf \/var\/log\/apache\r\n<\/pre>\n
# ionice -c 2 -n 6 rm \/var\/logs\/syslog\r\n# ionice -c 2 -n 6 rm -rf \/var\/log\/apache\r\n<\/pre>\n
# man ionice \r\n<\/pre>\n
\n
\n\n