netstat 是用來看哪些 port 被使用的好工具

 

netstat.jpg

 

搭配 grep 可以看有沒有人使用 port 21

netstat -tuln| grep 21

 

相關參數

-n // 改顯示 ip , 不顯示名稱

-l // 顯示 listening 的 socket

-t // 只顯示 tcp

-u // 只顯示 udp

-p // 顯示 PID

-a // 顯示 listening 和 non-listening socket

 

UDP 的 state 會是空白

 

netstat -h 可顯示更多使用說明

 

待續

喜歡我文章的朋友們 , 請幫忙按個讚 , 感謝啦 ~  

相關文章