linux ps查看进程命令ps命令作用:将某个时间点的程序运作情况撷取下来 实例: [root@linux ~]# ps aux [root@linux ~]# ps -lA [root@linux ~]# ps axjf 参数: -A :所有的 process 均显示出来,与 -e 具有同样的效用: -a :不与 terminal 有关的所有 process : -u :有效使用者 (effective user) 相关的 process : x :通常与 a 这个参数一起使用,可列出较完整
1. 查看所有进程 ps -eF -e: Select all processes.-F: Extra full format. PSR (Processor)显示进程所在的CPU. 2. 查看所有进程(包括线程) ps -eLF -e: Select all processes.-L: Show threads, possibly with LWP and NLWP columns.-F: Extra full format. LWP (Low Weight Process),显示的是线程号T
PID 进程号 USER 用户名 PR 优先级 NI nice值.负值表示高优先级,正值表示低优先级 RES 进程使用的.未被换出的物理内存大小,单位Kb S 进程状态: D 不可中断的睡眠状态 R 运行状态 S 睡眠 T 跟踪/停止 Z 僵尸进程 %CPU CPU使用率 %MEM 进程使用的物理内存百分比 TIME+ 进程使用的CPU时间总计,单位1/100秒 COMMAND 执行命令 参考:http://blog.csdn.net/lxpbs8851/article/details/8229
cpu的计算 ps cpu的定义 man page中给出的定义: cpu utilization of the process in "##.#" format. Currently, it is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a percentage. It will not add up to 100%