{"id":211950,"date":"2021-02-28T08:17:16","date_gmt":"2021-02-28T00:17:16","guid":{"rendered":"https:\/\/gulass.cn\/?p=211950"},"modified":"2021-02-22T09:19:48","modified_gmt":"2021-02-22T01:19:48","slug":"learn-how-to-2","status":"publish","type":"post","link":"https:\/\/gulass.cn\/learn-how-to-2.html","title":{"rendered":"\u5b66\u4e60\u4e0bLinux \u5982\u4f55\u67e5\u770b\u78c1\u76d8\u7a7a\u95f4"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nLinux \u67e5\u770b\u78c1\u76d8\u7a7a\u95f4\u53ef\u4ee5\u4f7f\u7528 df \u548c du \u547d\u4ee4\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

df<\/strong><\/div>\n

df \u4ee5\u78c1\u76d8\u5206\u533a\u4e3a\u5355\u4f4d\u67e5\u770b\u6587\u4ef6\u7cfb\u7edf\uff0c\u53ef\u4ee5\u83b7\u53d6\u786c\u76d8\u88ab\u5360\u7528\u4e86\u591a\u5c11\u7a7a\u95f4\uff0c\u76ee\u524d\u8fd8\u5269\u4e0b\u591a\u5c11\u7a7a\u95f4\u7b49\u4fe1\u606f\u3002<\/p>\n

\u4f8b\u5982\uff0c\u6211\u4eec\u4f7f\u7528df -h\u547d\u4ee4\u6765\u67e5\u770b\u78c1\u76d8\u4fe1\u606f\uff0c -h \u9009\u9879\u4e3a\u6839\u636e\u5927\u5c0f\u9002\u5f53\u663e\u793a\uff1a
\n\"\"<\/p>\n

\u663e\u793a\u5185\u5bb9\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n

    \n
  1. Filesystem<\/strong>\uff1a\u6587\u4ef6\u7cfb\u7edf<\/li>\n
  2. Size<\/strong>\uff1a \u5206\u533a\u5927\u5c0f<\/li>\n
  3. Used<\/strong>\uff1a \u5df2\u4f7f\u7528\u5bb9\u91cf<\/li>\n
  4. Avail<\/strong>\uff1a \u8fd8\u53ef\u4ee5\u4f7f\u7528\u7684\u5bb9\u91cf<\/li>\n
  5. Use%<\/strong>\uff1a \u5df2\u7528\u767e\u5206\u6bd4<\/li>\n
  6. Mounted on<\/strong>\uff1a \u6302\u8f7d\u70b9\u3000<\/li>\n<\/ol>\n

    \u76f8\u5173\u547d\u4ee4\uff1a<\/p>\n

      \n
    1. df -hl<\/strong>\uff1a\u67e5\u770b\u78c1\u76d8\u5269\u4f59\u7a7a\u95f4<\/li>\n
    2. df -h<\/strong>\uff1a\u67e5\u770b\u6bcf\u4e2a\u6839\u8def\u5f84\u7684\u5206\u533a\u5927\u5c0f<\/li>\n
    3. du -sh [\u76ee\u5f55\u540d]<\/strong>\uff1a\u8fd4\u56de\u8be5\u76ee\u5f55\u7684\u5927\u5c0f<\/li>\n
    4. du -sm [\u6587\u4ef6\u5939]<\/strong>\uff1a\u8fd4\u56de\u8be5\u6587\u4ef6\u5939\u603bM\u6570<\/li>\n
    5. du -h [\u76ee\u5f55\u540d]<\/strong>\uff1a\u67e5\u770b\u6307\u5b9a\u6587\u4ef6\u5939\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u5927\u5c0f\uff08\u5305\u542b\u5b50\u6587\u4ef6\u5939\uff09<\/li>\n<\/ol>\n
      du<\/strong><\/div>\n

      du \u7684\u82f1\u6587\u539f\u4e49\u4e3a disk usage\uff0c\u542b\u4e49\u4e3a\u663e\u793a\u78c1\u76d8\u7a7a\u95f4\u7684\u4f7f\u7528\u60c5\u51b5\uff0c\u7528\u4e8e\u67e5\u770b\u5f53\u524d\u76ee\u5f55\u7684\u603b\u5927\u5c0f\u3002<\/p>\n

      \u4f8b\u5982\u67e5\u770b\u5f53\u524d\u76ee\u5f55\u7684\u5927\u5c0f\uff1a<\/p>\n

      # du -sh\r\n605M<\/pre>\n

      .
      \n\u663e\u793a\u6307\u5b9a\u6587\u4ef6\u6240\u5360\u7a7a\u95f4\uff1a<\/p>\n

      # du log2012.log \r\n300     log2012.log<\/pre>\n

      \u65b9\u4fbf\u9605\u8bfb\u7684\u683c\u5f0f\u663e\u793atest\u76ee\u5f55\u6240\u5360\u7a7a\u95f4\u60c5\u51b5\uff1a<\/p>\n

      # du -h test\r\n608K    test\/test6\r\n308K    test\/test4\r\n4.0K    test\/scf\/lib\r\n4.0K    test\/scf\/service\/deploy\/product\r\n4.0K    test\/scf\/service\/deploy\/info\r\n12K     test\/scf\/service\/deploy\r\n16K     test\/scf\/service\r\n4.0K    test\/scf\/doc\r\n4.0K    test\/scf\/bin\r\n32K     test\/scf\r\n8.0K    test\/test3\r\n1.3M    test<\/pre>\n

      du \u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u5f53\u524d\u76ee\u5f55\u7684\u603b\u5927\u5c0f\uff1a<\/p>\n

        \n
      1. -s<\/strong>\uff1a\u5bf9\u6bcf\u4e2aNames\u53c2\u6570\u53ea\u7ed9\u51fa\u5360\u7528\u7684\u6570\u636e\u5757\u603b\u6570\u3002<\/li>\n
      2. -a<\/strong>\uff1a\u9012\u5f52\u5730\u663e\u793a\u6307\u5b9a\u76ee\u5f55\u4e2d\u5404\u6587\u4ef6\u53ca\u5b50\u76ee\u5f55\u4e2d\u5404\u6587\u4ef6\u5360\u7528\u7684\u6570\u636e\u5757\u6570\u3002\u82e5\u65e2\u4e0d\u6307\u5b9a-s\uff0c\u4e5f\u4e0d\u6307\u5b9a-a\uff0c\u5219\u53ea\u663e\u793aNames\u4e2d\u7684\u6bcf\u4e00\u4e2a\u76ee\u5f55\u53ca\u5176\u4e2d\u7684\u5404\u5b50\u76ee\u5f55\u6240\u5360\u7684\u78c1\u76d8\u5757\u6570\u3002<\/li>\n
      3. -b<\/strong>\uff1a\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\u5217\u51fa\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5\uff08\u7cfb\u7edf\u9ed8\u8ba4\u4ee5k\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002<\/li>\n
      4. -k<\/strong>\uff1a\u4ee51024\u5b57\u8282\u4e3a\u5355\u4f4d\u5217\u51fa\u78c1\u76d8\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5\u3002<\/li>\n
      5. -c<\/strong>\uff1a\u6700\u540e\u518d\u52a0\u4e0a\u4e00\u4e2a\u603b\u8ba1\uff08\u7cfb\u7edf\u9ed8\u8ba4\u8bbe\u7f6e\uff09\u3002<\/li>\n
      6. -l<\/strong>\uff1a\u8ba1\u7b97\u6240\u6709\u7684\u6587\u4ef6\u5927\u5c0f\uff0c\u5bf9\u786c\u94fe\u63a5\u6587\u4ef6\uff0c\u5219\u8ba1\u7b97\u591a\u6b21\u3002<\/li>\n
      7. -x<\/strong>\uff1a\u8df3\u8fc7\u5728\u4e0d\u540c\u6587\u4ef6\u7cfb\u7edf\u4e0a\u7684\u76ee\u5f55\u4e0d\u4e88\u7edf\u8ba1\u3002<\/li>\n
      8. -h<\/strong>\uff1a\u4ee5K\uff0cM\uff0cG\u4e3a\u5355\u4f4d\uff0c\u63d0\u9ad8\u4fe1\u606f\u7684\u53ef\u8bfb\u6027\u3002<\/li>\n<\/ol>\n
        \u53c2\u8003\u5185\u5bb9<\/strong><\/div>\n