Linux ps uax命令显示结果中的进程表示标识符

解释 ps 一般显示标识

在Linux 中使用 ps 会获得类似下列的进程展示
在这里插入图片描述
一般情况下都会存在stat 的属性

项目Value
stat进程状态
ppid父进程号,可以用getppid()获得
pid当前进程号,可以用getpid()获得
pgid表示组进程号 getgpid()获得

讲一下STAT 进程状态标识

那么接下来重点讲解一下STAT中的一系列表示
先放个原文

PROCESS STATE CODES
       Here are the different values that the s, stat and state output specifiers (header "STAT" or "S") will
       display to describe the state of a process:

               D    uninterruptible sleep (usually IO)
               R    running or runnable (on run queue)
               S    interruptible sleep (waiting for an event to complete)
               T    stopped, either by a job control signal or because it is being traced
               W    paging (not valid since the 2.6.xx kernel)
               X    dead (should never be seen)
               Z    defunct ("zombie") process, terminated but not reaped by its parent

       For BSD formats and when the stat keyword is used, additional characters may be displayed:

               <    high-priority (not nice to other users)
               N    low-priority (nice to other users)
               L    has pages locked into memory (for real-time and custom IO)
               s    is a session leader
               l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
               +    is in the foreground process group  

下面附带一些中文理解

标识含义
D不可中断 Uninterruptible sleep (usually IO)
R正在运行,或在队列中的进程
S处于休眠状态
T停止或被追踪
Z僵尸进程
W进入内存交换(从内核2.6开始无效)
X死掉的进程
特殊符号含义
<高优先级
N低优先级
L有些页被锁进内存
s包含子进程
+位于后台的进程组
l多线程,克隆线程 multi-threaded (using CLONE_THREAD, like NPTL pthreads do)

That`s all

最近又看到pcb和进程数的关系,不甚理解,下次再好好查查资料

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值