Mac系統檢視埠占用的程序

2021-09-25 04:30:35 字數 513 閱讀 9412

mac系統檢視埠占用的程序

原帖收藏於it老兵部落格

在linux下,檢視占用埠的程序可以使用netstat -antpl | grep port,但是在mac下,這個netstat的功能縮水了(很多命令在mac下都縮水了),所以怎麼檢視占用埠的程序呢?

搜尋了一遍,感覺可以使用lsof -i tcp:這個命令來實現,表示埠號。

-i [i]   selects the listing of files any of whose internet address

matches the address specified in i. if no address is

specified, this option selects the listing of all internet

and x.25 (hp-ux) network files.

Mac系統上檢視埠占用和釋放埠教程

在mac上進行開發時,可能會遇到埠被占用錯誤資訊,這時可以通過 終端 應用,使用命令 lsof i tcp port port替換成埠號,比如6379 8080 可以檢視該埠被什麼程式占用,並顯示pid,方便kill kill pid 1.檢視埠被哪個程式占用 sudo lsof i tcp por...

檢視某個埠占用的程序

1 檢視1660埠的使用pid c documents and settings ricky netstat ano findstr 1660 中大小寫敏感 tcp 192.168.1.6 1660 184.31.35.51 443 established 152 可以 netstat ano fi...

Mac檢視埠占用情況

mac下使用lsof list open files 來檢視埠占用情況,lsof 是乙個列出當前系統開啟檔案的工具。使用 lsof 會列舉所有占用的埠列表 lsof 使用less可以用於分頁展示,如 lsof less 也可以使用 i 檢視某個埠是否被占用,如 lsof i 3000 如果埠被占用,...