[問題] netstat

看板Linux作者 (.)時間12年前 (2013/03/08 07:39), 編輯推噓0(005)
留言5則, 3人參與, 最新討論串1/1
參考這個網頁 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 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 204.96.168.3

03/08 09:16, , 1F
-a的話 :80是顯示:www -an才會顯示 :80
03/08 09:16, 1F

03/08 09:16, , 2F
我系統的是這樣顯示
03/08 09:16, 2F

03/08 12:49, , 3F
因為沒有-n的話,:80會參照/etc/services被換成:http
03/08 12:49, 3F

03/08 12:49, , 4F
當然grep不到:80
03/08 12:49, 4F

03/09 08:02, , 5F
謝謝
03/09 08:02, 5F
文章代碼(AID): #1HEIKz_t (Linux)