windows linux mac检查端口是否被占用的方法

Commands to check that might be:
Linux/Mac:

lsof -i -P -n | grep LISTEN | grep <PORT_NUMBER>

Windows Powershell:

Get-NetTCPConnection | where Localport -eq <PORT_NUMBER> | select Localport,OwningProcess

Replace with 5432 and 8080. Empty output mean that the port is free and ready to go.

个人博客:https://chenzuoli.github.io/

你可能感兴趣的:(linux,运维,服务器,端口)