docker内部删除进程lsof、netstat、ps等命令

一、lsof命令

在Ubuntu内部安装lsof命令受阻,需要安装yum,但是安装不成功。

lsof查看端口号命令为:

lsof -i:XXX

二、netstat命令

安装net-tools:

# 更新apt
$ apt update

# 安装net-tools
$ apt install net-tools

使用netstat查找端口:

netstat -tlnp | grep XXX

三、ps命令

# ps命令
$ ps -aux|grep XXX.py

以上方法搜出PID后,使用kill -9 XXX命令删除进程。

猜你喜欢

转载自blog.csdn.net/buluxianfeng/article/details/125415930
今日推荐