LInux下Ubuntu下查看端口占用及关闭

1、查看所有进程

ps -ef

或者

ps -aux 

a:显示所有程序
u:以用户为主的格式来显示
x:显示所有程序,不以终端机来区分

2、查看使用某端口的占用

lsof -i:8080

或者:

netstat -ap|grep 8090 

 3、查看到进程id之后,使用netstat命令查看其占用的端口

netstat -nap | grep 8090

 4、使用kill终止后台运行的进程

kill -9 进程号

kill -9 8080

参考自https://www.cnblogs.com/baby123/p/6477429.html

猜你喜欢

转载自blog.csdn.net/weixin_38383877/article/details/83959822