技术小黑屋

List Ports on Linux

I have often suffered this painful thing.When I start a service but the destination port is always used.So I should list all open ports and kill the occupied application.
So This is a short tip for how to list open ports on Linux

1
sudo netstat -tulpn

Note sometimes you should grant the command for a enough access.
For a better understanding,please

1
man netstat

or navigate to http://linux.about.com/od/commands/l/blcmdl8_netstat.htm

For Mac Users

1
sudo lsof -i -P | grep -i "listen"

Others

我的博客即将搬运同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=2t07a740wrok0


我的知乎 Live 推荐