linux檢視埠常用命令

2022-05-04 19:03:29 字數 1061 閱讀 4506

netstat命令引數:

-t : 指明顯示tcp埠

-u : 指明顯示udp埠

-l : 僅顯示監聽套接字(所謂套接字就是使應用程式能夠讀寫與收發通訊協議(protocol)與資料的程式)

-p : 顯示程序識別符號和程式名稱,每乙個套接字/埠都屬於乙個程式。

-n : 不進行dns輪詢,顯示ip(可以加速操作)

即可顯示當前伺服器上所有埠及程序服務,於grep結合可檢視某個具體埠及服務情況··

netstat -ntlp   //

檢視當前所有tcp埠·

netstat -ntulp |grep 80

//檢視所有80埠使用情況·

netstat -an | grep 3306

//檢視所有3306埠使用情況·

檢視一台伺服器上面哪些服務及埠

netstat  -lanp

檢視乙個服務有幾個埠。比如要檢視mysqld

ps -ef |grep mysqld

檢視某一埠的連線數量,比如3306埠

netstat -pnt |grep :3306 |wc

檢視某一埠的連線客戶端ip 比如3306埠

netstat -anp |grep 3306

netstat -an 檢視網路埠

lsof -i :port,使用lsof -i :port就能看見所指定埠執行的程式,同時還有當前連線。
nmap 埠掃瞄

netstat -nupl (udp型別的埠)

netstat -ntpl (tcp型別的埠)

netstat -anp 顯示系統埠使用情況

Linux 檢視埠常用命令

一 firewall防火牆 檢視防火牆開放的埠 firewall cmd zone public list ports 檢視firewall服務狀態 systemctl status firewalld 檢視firewall的狀態 firewall cmd state 開啟 重啟 關閉 firewa...

常用命令 檢視埠

檢視埠被占用 netstat anp grep 6601 檢視埠資料 tcpdump port 6601 檢視發往ip的資料 tcpdump host ip window 檢視埠占用方法 netstat ano,列出所有埠的情況 netstat aon findstr 49157 回車,記下最後一位...

linux 設定埠常用命令

一 防火牆的狀態。有時開啟防火牆外部不能訪問。防火牆的命令 檢視防火牆狀態 systemctl status firewalld 開啟防火牆 systemctl start firewalld 關閉防火牆 systemctl stop firewalld 開啟防火牆 service firewall...