Linux下查看端口占用情况

用启动服务的账号登录,然后运行命令:
lsof -i:<端口号>
也可使用命令:
netstat -apn|grep <端口号>

找到进程号以后,再使用以下命令查看详细信息:
ps -aux|grep <进程号>

【注】最小化安装的Centos7系统并没有nano、vim、wget、curl、ifconfig、lsof命令,这里首先安装一下:

yum -y install nano vim wget curl net-tools lsof
原文地址:https://www.cnblogs.com/liaojie970/p/6489774.html