





{"id":1676,"date":"2011-01-11T23:41:41","date_gmt":"2011-01-12T03:41:41","guid":{"rendered":"http:\/\/www.killtest.hk\/?p=1676"},"modified":"2011-01-11T23:45:44","modified_gmt":"2011-01-12T03:45:44","slug":"1676","status":"publish","type":"post","link":"https:\/\/www.killtest.hk\/index.php\/unix\/1676\/","title":{"rendered":"\u8a73\u7d30\u5206\u6790Linux du\u547d\u4ee4\u7684\u4f7f\u7528"},"content":{"rendered":"<p>Linux du\u547d\u4ee4\u4e5f\u662f\u67e5\u770b\u4f7f\u7528\u7a7a\u9593\u7684\uff0c\u4f46\u662f\u8207df\u547d\u4ee4\u4e0d\u540c\u7684\u662fLinux du\u547d\u4ee4\u662f\u5c0d\u6587\u4ef6\u548c\u76ee\u9304\u78c1\u76e4\u4f7f\u7528\u7684\u7a7a\u9593\u7684\u67e5\u770b\uff0c\u9084\u662f\u548cdf\u547d\u4ee4\u6709\u58f9\u4e9b\u5340\u5225\u7684\uff0c\u9019\u88cf\u4ecb\u7d39Linux du\u547d\u4ee4\u3002<\/p>\n<p>\u3000\u3000du\uff1a\u67e5\u8a62\u6a94\u6848\u6216\u76ee\u9304\u7684\u78c1\u76e4\u4f7f\u7528\u7a7a\u9593<\/p>\n<p>\u3000\u3000a\uff1a\u986f\u793a\u5168\u90e8\u76ee\u9304\u548c\u5176\u6b21\u76ee\u9304\u4e0b\u7684\u6bcf\u500b\u6a94\u6848\u6240\u5360\u7684\u78c1\u76e4\u7a7a\u9593<\/p>\n<p>\u3000\u3000b\uff1a\u5927\u5c0f\u7528bytes\u4f86\u8868\u793a (\u9ed8\u8a8d\u503c\u70bak bytes)<\/p>\n<p>\u3000\u3000c\uff1a\u6700\u5f8c\u518d\u52a0\u4e0a\u7e3d\u8a08 (\u9ed8\u8a8d\u503c)<\/p>\n<p>\u3000\u3000s\uff1a\u53ea\u986f\u793a\u5404\u6a94\u6848\u5927\u5c0f\u7684\u7e3d\u5408<\/p>\n<p>\u3000\u3000x\uff1a\u53ea\u8a08\u7b97\u540c\u5c6c\u540c\u58f9\u500b\u6a94\u6848\u7cfb\u7d71\u7684\u6a94\u6848<\/p>\n<p>\u3000\u3000L\uff1a\u8a08\u7b97\u6240\u6709\u7684\u6a94\u6848\u5927\u5c0f<\/p>\n<p>\u3000\u3000\u5e38\u7528\u547d\u4ee4\uff1adu \u2013a<\/p>\n<p>\u3000\u3000\u64cd\u4f5c\u8a73\u89e3<\/p>\n<p>\u3000\u3000\u5f15\u7528<\/p>\n<p>\u3000\u3000\u6307\u4ee4 du \u80fd\u4ee5\u6307\u5b9a\u7684\u76ee\u9304\u4e0b\u7684\u5b50\u76ee\u9304\u70ba\u55ae\u4f4d\uff0c\u986f\u793a\u6bcf\u500b\u76ee\u9304\u5167\u6240\u6709\u6a94\u6848\u6240\u5360\u7528\u7684\u78c1\u76e4\u7a7a\u9593\u5927\u5c0f\u3002\u4f8b\u5982\uff1a<\/p>\n<p>\u3000\u3000# du -h \/etc<\/p>\n<p>\u3000\u3000104K \/etc\/defaults<\/p>\n<p>\u3000\u30006.0K \/etc\/X11<\/p>\n<p>\u3000\u30008.0K \/etc\/bluetooth<\/p>\n<p>\u3000\u30004.0K \/etc\/gnats<\/p>\n<p>\u3000\u300052K \/etc\/isdn<\/p>\n<p>\u3000\u3000388K \/etc\/mail<\/p>\n<p>\u3000\u300068K \/etc\/mtree<\/p>\n<p>\u3000\u30002.0K \/etc\/ntp<\/p>\n<p>\u3000\u300038K \/etc\/pam.d<\/p>\n<p>\u3000\u300044K \/etc\/periodic\/daily<\/p>\n<p>\u3000\u30006.0K \/etc\/periodic\/monthly<\/p>\n<p>\u3000\u300042K \/etc\/periodic\/security<\/p>\n<p>\u3000\u300016K \/etc\/periodic\/weekly<\/p>\n<p>\u3000\u3000110K \/etc\/periodic<\/p>\n<p>\u3000\u30006.0K \/etc\/ppp<\/p>\n<p>\u3000\u3000318K \/etc\/rc.d<\/p>\n<p>\u3000\u30002.0K \/etc\/skel<\/p>\n<p>\u3000\u3000130K \/etc\/ssh<\/p>\n<p>\u3000\u300010K \/etc\/ssl<\/p>\n<p>\u3000\u30001.7M \/etc<\/p>\n<p>\u3000\u3000\u6211\u5011\u76ee\u6a23\u4f7f\u7528 -h \u53c3\u6578\u4f86\u986f\u793a human-readable \u7684\u683c\u5f0f\u3002\u5728\u61c9\u7528\u6642\uff0c\u6211\u5011\u53ef\u4ee5\u4f7f\u7528 du \u9019\u500b\u6307\u4ee4\u4f86\u67e5\u770b\u54ea\u500b\u76ee\u9304\u5360\u7528\u6700\u591a\u7684\u7a7a\u9593\u3002\u4e0d\u904e\uff0cdu \u7684\u8f38\u51fa\u7d50\u679c\u901a\u5e38\u5f88\u9577\uff0c\u6211\u5011\u53ef\u4ee5\u52a0\u4e0a -s \u53c3\u6578\u4f86\u7701\u7565\u6307\u5b9a\u76ee\u9304\u4e0b\u7684\u5b50\u76ee\u9304\uff0c\u800c\u53ea\u986f\u793a\u8a72\u76ee\u9304\u7684\u7e3d\u5408\u5373\u53ef\uff1a<\/p>\n<p>\u3000\u3000# du -sh \/etc<\/p>\n<p>\u3000\u30001.7M \/etc<\/p>\n<p>\u3000\u3000\u5728\u67e5\u770b\u76ee\u9304\u7684\u4f7f\u7528\u60c5\u5f62\u6642\uff0c\u6211\u5011\u53ef\u4ee5\u5c07\u8f38\u51fa\u7d50\u679c\u5c0e\u5230 sort \u6307\u4ee4\u9032\u884c\u6392\u5e8f\uff0c\u4ee5\u4e86\u89e3\u54ea\u500b\u6a94\u6848\u7528\u4e86\u6700\u591a\u7684\u7a7a\u9593\uff1a<\/p>\n<p>\u3000\u3000# du \/etc | sort -nr | more<\/p>\n<p>\u3000\u30001746 \/etc<\/p>\n<p>\u3000\u3000388 \/etc\/mail<\/p>\n<p>\u3000\u3000318 \/etc\/rc.d<\/p>\n<p>\u3000\u3000130 \/etc\/ssh<\/p>\n<p>\u3000\u3000110 \/etc\/periodic<\/p>\n<p>\u3000\u3000104 \/etc\/defaults<\/p>\n<p>\u3000\u300068 \/etc\/mtree<\/p>\n<p>\u3000\u300052 \/etc\/isdn<\/p>\n<p>\u3000\u300044 \/etc\/periodic\/daily<\/p>\n<p>\u3000\u300042 \/etc\/periodic\/security<\/p>\n<p>\u3000\u300038 \/etc\/pam.d<\/p>\n<p>\u3000\u300016 \/etc\/periodic\/weekly<\/p>\n<p>\u3000\u300010 \/etc\/ssl<\/p>\n<p>\u3000\u30008 \/etc\/bluetooth<\/p>\n<p>\u3000\u30006 \/etc\/ppp<\/p>\n<p>\u3000\u30006 \/etc\/periodic\/monthly<\/p>\n<p>\u3000\u30006 \/etc\/X11<\/p>\n<p>\u3000\u30004 \/etc\/gnats<\/p>\n<p>\u3000\u30002 \/etc\/skel<\/p>\n<p>\u3000\u30002 \/etc\/ntp<\/p>\n<p>\u3000\u3000sort \u7684\u53c3\u6578 -nr \u8868\u793a\u8981\u4ee5\u6578\u5b57\u6392\u5e8f\u6cd5\u9032\u884c\u53cd\u5411\u6392\u5e8f\uff0c\u56e0\u70ba\u6211\u5011\u8981\u5c0d\u76ee\u9304\u5927\u5c0f\u505a\u6392\u5e8f\uff0c\u6240\u4ee5\u4e0d\u53ef\u4ee5\u4f7f\u7528 human-readable \u7684\u5927\u5c0f\u8f38\u51fa\uff0c\u4e0d\u7136\u76ee\u9304\u5927\u5c0f\u4e2d\u6703\u6709 K\u3001M \u7b49\u5b57\u6a23\uff0c\u6703\u9020\u6210\u6392\u5e8f\u4e0d\u6b63\u78ba\u3002<\/p>\n<p>\u3000\u3000\u73fe\u5728\u660e\u4e86\u4e86Linux du\u547d\u4ee4\u548cLinux df\u547d\u4ee4\u7684\u4e0d\u540c\u4e4b\u8655\u4e86\u55ce\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux du\u547d\u4ee4\u4e5f\u662f\u67e5\u770b\u4f7f\u7528\u7a7a\u9593\u7684\uff0c\u4f46\u662f\u8207df\u547d\u4ee4\u4e0d\u540c\u7684\u662fLinux du\u547d\u4ee4\u662f\u5c0d\u6587\u4ef6\u548c\u76ee\u9304\u78c1\u76e4\u4f7f\u7528\u7684\u7a7a\u9593 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[531],"tags":[688,295],"class_list":["post-1676","post","type-post","status-publish","format-standard","hentry","category-unix","tag-du","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/posts\/1676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/comments?post=1676"}],"version-history":[{"count":0,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/posts\/1676\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/media?parent=1676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/categories?post=1676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/tags?post=1676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}