linux - linux查看进程内存cpu/僵尸进程/死进程

1.top/htop

查看内存、cpu / q 退出

2.ps 查看当前所有进程

ps -ef

ps -ef | grep python

ps -aux

3.Linux僵尸进程排查

#yum install -y htop iotop smem

#查看进程使用的内存量

smem -k -s uss

#查看进程使用的内部百分比

smem -p -s uss

#查看每个用户使用的内存量

smem -u -k

#查看单个进程使用的内存量

smem -P ./perf -k

#获取内存使用最大的10个进程

ps aux|head -1;ps aux|sort -nr -k4|head -10

#获取CPU使用最大的10个进程

ps aux|head -1;ps aux|sort -nr -k3|head -10

#查找僵尸进程

ps -e -o stat,ppid,pid,cmd|grep -e '^[zZ]'

#杀死僵死进程

ps -e -o stat,ppid,pid,cmd|grep -e '^[zZ]'|awk '{print $2}'|xargs kill -9

猜你喜欢

转载自blog.csdn.net/helunqu2017/article/details/113822971