标签:style blog color os strong ar art div
1.查看进程
ps - processes snapshot
ps aue
ps -elf
[root@localhost ~]# ps aue USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 3360 0.0 0.0 3816 500 tty1 Ss+ 18:51 0:00 /sbin/mingetty tty1 HOME=/ TERM=linux SELINUX_INIT=YES PATH=/bin:/usr/bin:/sbin:/usr/sbin RUNLEVEL=5 PREVLEVEL=N root 3361 0.0 0.0 3816 496 tty2 Ss+ 18:51 0:00 /sbin/mingetty tty2 HOME=/ TERM=linux SELINUX_INIT=YES PATH=/bin:/usr/bin:/sbin:/usr/sbin RUNLEVEL=5 PREVLEVEL=N
【注:】STAT
-R running 正在运行
-S sleep 正在休眠,需要时可唤醒
-Z 僵尸进程,进程结束,内存没有释放,kill
top -d【刷新秒数】 -U【用户名】
[root@localhost ~]# top -d10 #q:退出 k:杀死进程 shift+p根据cpu进行排序,shift+m根据mem进行倒叙 top - 19:57:14 up 1:07, 1 user, load average: 0.56, 0.15, 0.05 Tasks: 103 total, 2 running, 101 sleeping, 0 stopped, 0 zombie Cpu(s): 0.1%us, 0.4%sy, 0.0%ni, 97.2%id, 2.1%wa, 0.0%hi, 0.1%si, 0.0%st Mem: 507512k total, 461024k used, 46488k free, 73636k buffers Swap: 1052248k total, 0k used, 1052248k free, 227088k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 5929 root 36 19 121m 7772 2604 R 6.0 1.5 0:00.03 rhsmd 1 root 15 0 10372 700 588 S 0.0 0.1 0:00.85 init
pgrep 检索进程信息
[root@localhost ~]# pgrep -l -U yimiao 10513 sshd 10514 bash 10536 vim
pstree 进程数
[root@localhost ~]# pstree -aup
[root@localhost ~]# pstree -p yimiao
sshd(10513)───bash(10514)───vim(10568)
标签:style blog color os strong ar art div
原文地址:http://www.cnblogs.com/yimiao/p/3917597.html