netstat - Linux

Table of Contents

參考這個網頁
http://www.thegeekstuff.com/2010/03/netstat-command-examples/

想查找所有使用port 80的 process
$ netstat -an | grep ':80'
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 1 0 10.100.21.52:49756 91.189.89.144:80 CLOSE_WAIT

但是如果我用
$ netstat -a | grep ':80'
卻沒有任何回傳

但是按照網頁敘述
-a 和 -an的區別是
When you don’t want the name of the host, port or user to be displayed, use
netstat -n option.

照理來說 -a應該也會有回傳值才對
甚至應該回傳更多資訊(host / port / user)
請問為什麼我沒得到任何回傳值呢?

thx

--

All Comments

Dora avatarDora2013-03-09
-a的話 :80是顯示:www -an才會顯示 :80
我系統的是這樣顯示
Charlotte avatarCharlotte2013-03-12
因為沒有-n的話,:80會參照/etc/services被換成:http
當然grep不到:80
Adele avatarAdele2013-03-12
謝謝