常用Shell命令汇总

2024-06-21 127 0

# 获取IP连接所在进程PID
ss -ntep | grep 59.110.246.82

# 获取IP连接所在进程PID 只取PID
ss -ntep | grep 59.110.246.82 | awk -F '=' '{print $2}' | awk -F ',' '{print $1}'

# 获取IP连接所有进程详情
ss -ntep | grep 59.110.246.82 | awk -F '=' '{print $2}' | awk -F ',' '{print $1}' | while read -r pid; do ps -ef | grep -v grep | grep "$pid"; done

相关文章

发布评论