查看端口占用

lsof -i:端口号

##用以显示符合条件的进程情况,lsof(list open files)是一个列出当前系统打开文件的工具。以root用户来执行lsof -i命令

netstat -tunlp|grep 端口号

##用于显示tcp,udp的端口和进程等相关情况