shell基础——端口与进程
1、查看TCP/UDP的端口号:
netstat -tupln
2、根据端口查看运行的进程:
方法1: netstat -anp|grep 3030
方法2: lsof -i :22
3、查看进程名运行的端口号:
netstat -anp|grep 进程名
4、查看进程信息
netstat -tln //查看服务监听端口
netstat //查看进程号
ps -aux //查看进程号
ps -aux | more //全部查看
ps -ef | grep mysql //查看mysql的进程