{"id":52330,"date":"2024-12-03T10:12:32","date_gmt":"2024-12-03T02:12:32","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52330\/"},"modified":"2024-12-03T10:12:32","modified_gmt":"2024-12-03T02:12:32","slug":"linux%e6%80%8e%e4%b9%88%e6%9f%a5%e7%9c%8b%e8%bf%9b%e7%a8%8b%e5%8d%a0%e7%94%a8%e7%bd%91%e9%80%9f%e5%92%8c%e6%b5%81%e9%87%8f%e7%9a%84%e4%bd%bf%e7%94%a8%e6%83%85%e5%86%b5","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52330\/","title":{"rendered":"linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5<\/h1>\n<p>\u4eb2\u7231\u7684\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5982\u679c\u4f60\u70b9\u5f00\u4e86\u8fd9\u7bc7\u6587\u7ae0\uff0c\u8bf4\u660e\u4f60\u5bf9\u300alinux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u300b\u5f88\u611f\u5174\u8da3\u3002\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u7ed9\u5927\u5bb6\u8be6\u7ec6\u89e3\u6790\u4e00\u4e0b\uff0c\u4e3b\u8981\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u6240\u6709\u8ba4\u771f\u8bfb\u5b8c\u7684\u7ae5\u978b\u4eec\uff0c\u90fd\u6709\u5b9e\u8d28\u6027\u7684\u63d0\u9ad8\u3002<\/p>\n<p><strong>\u6709\u4e09\u4e2a\u547d\u4ee4vnstat\u3001iftop\u3001nethogs\uff08\u63a8\u8350\uff09<\/strong><\/p>\n<p>\u90fd\u9700\u8981\u989d\u5916\u5b89\u88c5\u8f6f\u4ef6 \u4f7f\u7528yum\u6216apt-get<\/p>\n<h3>\u4e00\u3001vnstat\u4f7f\u7528\uff0c\u67e5\u770b\u63a5\u53e3\u7edf\u8ba1\u62a5\u544a<\/h3>\n<pre>vnstat&nbsp;-i&nbsp;eth0&nbsp;-l&nbsp;#\u5b9e\u65f6\u6d41\u91cf\u60c5\u51b5<\/pre>\n<p>\u8fd8\u6709\u5176\u4ed6\u547d\u4ee4\u4f7f\u7528&#8211;help\u67e5\u770b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20240424\/171392906966287b6d7561d.jpg\" class=\"aligncenter\" title=\"linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u63d2\u56fe\" alt=\"linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u63d2\u56fe\" \/><\/p>\n<p>ctrl+c\u7ed3\u675f\u540e\uff0c\u4f1a\u663e\u793a\u76d1\u63a7\u671f\u95f4\u7684\u6d41\u91cf\u7edf\u8ba1\u7ed3\u679c<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20240424\/171392906966287b6d7961d.png\" class=\"aligncenter\" title=\"linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u63d2\u56fe1\" alt=\"linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u63d2\u56fe1\" \/><\/p>\n<h3>\u4e8c\u3001iftop\u4f7f\u7528\uff0c\u68c0\u67e5\u5e26\u5bbd\u4f7f\u7528\u60c5\u51b5<\/h3>\n<p>iftop\u53ef\u4ee5\u7528\u6765\u76d1\u63a7\u7f51\u5361\u7684\u5b9e\u65f6\u6d41\u91cf\uff08\u53ef\u4ee5\u6307\u5b9a\u7f51\u6bb5\uff09\u3001\u53cd\u5411\u89e3\u6790IP\u3001\u663e\u793a\u7aef\u53e3\u4fe1\u606f\u7b49<\/p>\n<p><strong>\u547d\u4ee4\u7528\u6cd5\uff1a<\/strong><\/p>\n<ul>\n<li>\n<p><code>-i<\/code>\u8bbe\u5b9a\u76d1\u6d4b\u7684\u7f51\u5361\uff0c\u5982\uff1a# iftop -i eth2<\/p>\n<\/li>\n<li>\n<p><code>-B<\/code> \u4ee5bytes\u4e3a\u5355\u4f4d\u663e\u793a\u6d41\u91cf(\u9ed8\u8ba4\u662fbits)\uff0c\u5982\uff1a# iftop -B<\/p>\n<\/li>\n<li>\n<p><code>-n<\/code>\u4f7fhost\u4fe1\u606f\u9ed8\u8ba4\u76f4\u63a5\u90fd\u663e\u793aIP\uff0c\u5982\uff1a# iftop -n<\/p>\n<\/li>\n<li>\n<p><code>-N<\/code>\u4f7f\u7aef\u53e3\u4fe1\u606f\u9ed8\u8ba4\u76f4\u63a5\u90fd\u663e\u793a\u7aef\u53e3\u53f7\uff0c\u5982: # iftop -N<\/p>\n<\/li>\n<\/ul>\n<p>\u7701\u7565\u5176\u4ed6&amp;hellip;&amp;hellip;<\/p>\n<p><strong>\u4ea4\u4e92\u547d\u4ee4\uff1a<\/strong><\/p>\n<ul>\n<li>\n<p>\u6309n\u5207\u6362\u663e\u793a\u672c\u673a\u7684IP\u6216\u4e3b\u673a\u540d;<\/p>\n<\/li>\n<li>\n<p>\u6309s\u5207\u6362\u662f\u5426\u663e\u793a\u672c\u673a\u7684host\u4fe1\u606f;<\/p>\n<\/li>\n<li>\n<p>\u6309d\u5207\u6362\u662f\u5426\u663e\u793a\u8fdc\u7aef\u76ee\u6807\u4e3b\u673a\u7684host\u4fe1\u606f;<\/p>\n<\/li>\n<li>\n<p>\u6309t\u5207\u6362\u663e\u793a\u683c\u5f0f\u4e3a2\u884c\/1\u884c\/\u53ea\u663e\u793a\u53d1\u9001\u6d41\u91cf\/\u53ea\u663e\u793a\u63a5\u6536\u6d41\u91cf;<\/p>\n<\/li>\n<li>\n<p>\u6309N\u5207\u6362\u663e\u793a\u7aef\u53e3\u53f7\u6216\u7aef\u53e3\u670d\u52a1\u540d\u79f0;<\/p>\n<\/li>\n<li>\n<p>\u6309S\u5207\u6362\u662f\u5426\u663e\u793a\u672c\u673a\u7684\u7aef\u53e3\u4fe1\u606f;<\/p>\n<\/li>\n<li>\n<p>\u6309D\u5207\u6362\u662f\u5426\u663e\u793a\u8fdc\u7aef\u76ee\u6807\u4e3b\u673a\u7684\u7aef\u53e3\u4fe1\u606f;<\/p>\n<\/li>\n<li>\n<p>\u6309p\u5207\u6362\u662f\u5426\u663e\u793a\u7aef\u53e3\u4fe1\u606f;<\/p>\n<\/li>\n<li>\n<p>\u7701\u7565\u5176\u4ed6&amp;hellip;&amp;hellip;<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u4f7f\u7528\u622a\u56fe\uff1a<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20240424\/171392906966287b6d7d551.png\" class=\"aligncenter\" title=\"linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u63d2\u56fe2\" alt=\"linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u63d2\u56fe2\" \/><\/p>\n<h3>\u4e09\u3001nethogs\u4f7f\u7528\uff0c\u6309\u8fdb\u7a0b\u5b9e\u65f6\u7edf\u8ba1\u7f51\u7edc\u5e26\u5bbd\u5229\u7528\u7387(\u63a8\u8350)<\/h3>\n<p><strong>\u547d\u4ee4\u7528\u6cd5\uff1a<\/strong><\/p>\n<p>1\u3001\u8bbe\u7f6e5\u79d2\u949f\u5237\u65b0\u4e00\u6b21\uff0c\u901a\u8fc7-d\u6765\u6307\u5b9a\u5237\u65b0\u9891\u7387\uff1anethogs -d 5<\/p>\n<p>2\u3001\u76d1\u89c6eth0\u7f51\u7edc\u5e26\u5bbd :nethogs eth0<\/p>\n<p>3\u3001\u540c\u65f6\u76d1\u89c6eth0\u548ceth2\u63a5\u53e3 : nethogs eth0 eth2&nbsp;<\/p>\n<p><strong>\u4ea4\u4e92\u547d\u4ee4\uff1a<\/strong><\/p>\n<p>\u4ee5\u4e0b\u662fNetHogs\u7684\u4e00\u4e9b\u4ea4\u4e92\u547d\u4ee4(\u952e\u76d8\u5feb\u6377\u952e)<\/p>\n<ul>\n<li>\n<p><code>m <\/code>: \u4fee\u6539\u5355\u4f4d<\/p>\n<\/li>\n<li>\n<p><code>r<\/code> : \u6309\u6d41\u91cf\u6392\u5e8f<\/p>\n<\/li>\n<li>\n<p><code>s<\/code> : \u6309\u53d1\u9001\u6d41\u91cf\u6392\u5e8f<\/p>\n<\/li>\n<li>\n<p><code>q<\/code> : \u9000\u51fa\u547d\u4ee4\u63d0\u793a\u7b26<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u4f7f\u7528\u622a\u56fe\uff1a<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20240424\/171392906966287b6d831b5.png\" class=\"aligncenter\" title=\"linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u63d2\u56fe3\" alt=\"linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u63d2\u56fe3\" \/><\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u300alinux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u300b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u5173\u4e8eLinux\u7684\u8d44\u6599\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>linux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5 \u4eb2\u7231\u7684\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5982\u679c\u4f60\u70b9\u5f00\u4e86\u8fd9\u7bc7\u6587\u7ae0\uff0c\u8bf4\u660e\u4f60\u5bf9\u300alinux\u600e\u4e48\u67e5\u770b\u8fdb\u7a0b\u5360\u7528\u7f51\u901f\u548c\u6d41\u91cf\u7684\u4f7f\u7528\u60c5\u51b5\u300b\u5f88\u611f\u5174\u8da3\u3002\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u7ed9\u5927\u5bb6\u8be6\u7ec6\u89e3\u6790\u4e00\u4e0b\uff0c\u4e3b\u8981\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u6240\u6709\u8ba4\u771f\u8bfb\u5b8c\u7684\u7ae5\u978b\u4eec\uff0c\u90fd\u6709\u5b9e\u8d28\u6027\u7684\u63d0\u9ad8\u3002 \u6709\u4e09\u4e2a\u547d\u4ee4vnstat\u3001iftop\u3001nethogs\uff08\u63a8\u8350\uff09 \u90fd\u9700\u8981\u989d\u5916\u5b89\u88c5\u8f6f\u4ef6 \u4f7f\u7528yum\u6216apt-get \u4e00\u3001vnstat\u4f7f\u7528\uff0c\u67e5\u770b\u63a5\u53e3\u7edf\u8ba1\u62a5\u544a vnstat&nbsp;-i&nbsp;eth0&nbsp;-l&nbsp;#\u5b9e\u65f6\u6d41\u91cf\u60c5\u51b5 \u8fd8\u6709\u5176\u4ed6\u547d\u4ee4\u4f7f\u7528&#8211;help\u67e5\u770b ctrl+c\u7ed3\u675f\u540e\uff0c\u4f1a\u663e\u793a\u76d1\u63a7\u671f\u95f4\u7684\u6d41\u91cf\u7edf\u8ba1\u7ed3\u679c \u4e8c\u3001iftop\u4f7f\u7528\uff0c\u68c0\u67e5\u5e26\u5bbd\u4f7f\u7528\u60c5\u51b5 iftop\u53ef\u4ee5\u7528\u6765\u76d1\u63a7\u7f51\u5361\u7684\u5b9e\u65f6\u6d41\u91cf\uff08\u53ef\u4ee5\u6307\u5b9a\u7f51\u6bb5\uff09\u3001\u53cd\u5411\u89e3\u6790IP\u3001\u663e\u793a\u7aef\u53e3\u4fe1\u606f\u7b49 \u547d\u4ee4\u7528\u6cd5\uff1a -i\u8bbe\u5b9a\u76d1\u6d4b\u7684\u7f51\u5361\uff0c\u5982\uff1a# iftop -i eth2 -B \u4ee5bytes\u4e3a\u5355\u4f4d\u663e\u793a\u6d41\u91cf(\u9ed8\u8ba4\u662fbits)\uff0c\u5982\uff1a# iftop -B -n\u4f7fhost\u4fe1\u606f\u9ed8\u8ba4\u76f4\u63a5\u90fd\u663e\u793aIP\uff0c\u5982\uff1a# iftop -n -N\u4f7f\u7aef\u53e3\u4fe1\u606f\u9ed8\u8ba4\u76f4\u63a5\u90fd\u663e\u793a\u7aef\u53e3\u53f7\uff0c\u5982: # iftop -N \u7701\u7565\u5176\u4ed6&amp;hellip;&amp;hellip; \u4ea4\u4e92\u547d\u4ee4\uff1a \u6309n\u5207\u6362\u663e\u793a\u672c\u673a\u7684IP\u6216\u4e3b\u673a\u540d; \u6309s\u5207\u6362\u662f\u5426\u663e\u793a\u672c\u673a\u7684host\u4fe1\u606f; \u6309d\u5207\u6362\u662f\u5426\u663e\u793a\u8fdc\u7aef\u76ee\u6807\u4e3b\u673a\u7684host\u4fe1\u606f; \u6309t\u5207\u6362\u663e\u793a\u683c\u5f0f\u4e3a2\u884c\/1\u884c\/\u53ea\u663e\u793a\u53d1\u9001\u6d41\u91cf\/\u53ea\u663e\u793a\u63a5\u6536\u6d41\u91cf; \u6309N\u5207\u6362\u663e\u793a\u7aef\u53e3\u53f7\u6216\u7aef\u53e3\u670d\u52a1\u540d\u79f0; \u6309S\u5207\u6362\u662f\u5426\u663e\u793a\u672c\u673a\u7684\u7aef\u53e3\u4fe1\u606f; \u6309D\u5207\u6362\u662f\u5426\u663e\u793a\u8fdc\u7aef\u76ee\u6807\u4e3b\u673a\u7684\u7aef\u53e3\u4fe1\u606f; \u6309p\u5207\u6362\u662f\u5426\u663e\u793a\u7aef\u53e3\u4fe1\u606f; \u7701\u7565\u5176\u4ed6&amp;hellip;&amp;hellip; \u4f7f\u7528\u622a\u56fe\uff1a \u4e09\u3001nethogs\u4f7f\u7528\uff0c\u6309\u8fdb\u7a0b\u5b9e\u65f6\u7edf\u8ba1\u7f51\u7edc\u5e26\u5bbd\u5229\u7528\u7387(\u63a8\u8350) \u547d\u4ee4\u7528\u6cd5\uff1a 1\u3001\u8bbe\u7f6e5\u79d2\u949f\u5237\u65b0\u4e00\u6b21\uff0c\u901a\u8fc7-d\u6765\u6307\u5b9a\u5237\u65b0\u9891\u7387\uff1anethogs -d 5 2\u3001\u76d1\u89c6eth0\u7f51\u7edc\u5e26\u5bbd :nethogs eth0 3\u3001\u540c\u65f6\u76d1\u89c6eth0\u548ceth2\u63a5\u53e3 : nethogs eth0 eth2&nbsp; \u4ea4\u4e92\u547d\u4ee4\uff1a \u4ee5\u4e0b\u662fNetHogs\u7684\u4e00\u4e9b\u4ea4\u4e92\u547d\u4ee4(\u952e\u76d8\u5feb\u6377\u952e) m [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-52330","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=52330"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52330\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}