【Linux學習筆記】netstat命令

來源:互聯網
上載者:User

luoluo牛再一次給我展示了他強大的linux能力,現總結下netstat的用法。


首先,看下netstat的man page:

NAME

 netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

可以看到,netstat命令可以列印網路連接、路由表、介面統計、偽裝連結和多播成員。


SYNOPSIS

       netstat    [--all|-a] [--numeric|-n] [--tcp|-t]  [--udp|-u] [--listening|-l]  [--program|-p][--statistics|-s]  [--help|-h]


參數解釋:

netstat -a : 顯示所有串連中和等待中的socket狀態

netstat -n : 顯示網路狀態時,以數字表示地址(如localhost表示成127.0.0.1)

netstat -s : 按網路通訊協定分類展示網路統計

netstat -t  : 顯示TCP協議網路狀態

netstat -u : 顯示UDP協議網路狀態

netstat -p : 顯示進程名


常用組合:

1.netstat -an (Listing all the LISTENING Ports of TCP and UDP connections)

2.netstat -at (Listing only TCP (Transmission Control Protocol) port connections using netstat -at.)

3.netstat -l   (Listing all active listening ports connections with netstat -l.)

4.netstat -tp (Displaying service name with their PID number, using option netstat -tp will display “PID/Program Name”.)




參考:

http://www.tecmint.com/20-netstat-commands-for-linux-network-management/

http://write.blog.csdn.net/postedit/17555445

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.