PS命令:

/proc目录:内核中的状态信息
内核参数:
可设置其值从而调整内核运行特性的参数;/proc/sys
状态变量:其用于输出内核中统计信息或状态信息,仅用于查看;

        参数:模拟成文件系统类型;

ps - report a snapshot of the current processes.
ps [options]
选项有三种网格:
1 UNIX options, which may be grouped and must be preceded by a dash.
Unix选项,可以分组,前面必须加破折号
2 BSD options, which may be grouped and must not be used with a dash.
BSD选项,可以分组,不能与破折号一起使用
3 GNU long options, which are preceded by two dashes.
GNU长选项,前面有两个破折号

启运进程的方式:
系统启动过程中自动启动:与终端无关的进程;
用户通过终端启动:与终端相关的进程;

选项:
a :所有与终端相关的进程;
x :所有与终端无关的进程;
u :以用户为中心组织进程状态信息显示;

   常用组合之一:aux
      VSZ:虚拟内存集;
      RSS:常驻内存集;Resident Size
      STAT:
            R:runnig     运行态
            S:interruptable sleeping    可中断睡眠态
            D:uninterruptable sleeping  不可中断睡眠态
            T:stopped    停止态
            Z:zombie     僵死态
            +:前台进程
            l:多线程进程
            N:低优先级进程
            <:高优先级进程
            s:session leader

  常用组合之二:-ef
  -e:显示所有进程
  -f:显示完整格式的进程信息
  -F:显示完整格式的进程信息;
    C:cpu utillzation
    PSR:运行于哪颗CPU上
  -H:以层级结构显示进程的相关信息;

  常用组合之三:-eFH
  常用组合之四:ps axo [field1][field2]...
                              ps -eo [field1][field2]...
常用的field:[pid,ni,prl,psr,pcpu,stat,comm,tty,ppid]
        ni:niceWFHG;
        pri:priority优先级
        rtpri:real time priority实时优先级 

猜你喜欢

转载自blog.51cto.com/python20101030/2338900
今日推荐