#查看进程资源使用情况以及对应cpu核
ps -eo user,stat,pid,psr,vsz,rss,%cpu,%mem,comm | sort -k +5 -nr | column -t
#查看linux服务器tcp端口状态及其对应ip
netstat -ant | awk '$NF!~/State/&&$NF~/TIME_WAIT/{split($5,array,":");sum[array[1]]++;num[$6]++}END{for(i in sum) for(j in num) print sum[i],i,j}' | sort -k 1 -nr | head -20
#依据机器负载排查可疑进程
sar -q -f sa01
![机器负载](https://img.haomeiwen.com/i9342331/22f30704f8e9ca14.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
ps -eo pid,lstart,etime,cmd | awk '$5~/12/{print}'
网友评论