设为首页 收藏本站
查看: 978|回复: 0

[经验分享] Linux 进程状态

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-2-4 08:21:28 | 显示全部楼层 |阅读模式
                      
往往,我们PS查看进程的时候,可以看到STAT一栏中,表示进程的状态;

[iyunv@iZ28lzm2ehvZ ~]# ps axu
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  10368   148 ?        Ss    2014   0:02 init [3]
root         2  0.0  0.0      0     0 ?        S<    2014   0:00 [migration/0]
root         3  0.0  0.0      0     0 ?        SN    2014   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S<    2014   0:00 [watchdog/0]
root         5  0.0  0.0      0     0 ?        S<    2014   0:03 [events/0]
root         6  0.0  0.0      0     0 ?        S<    2014   0:00 [khelper]
root        11  0.0  0.0      0     0 ?        S<    2014   0:00 [kthread]
root        15  0.0  0.0      0     0 ?        S<    2014   0:01 [kblockd/0]
root        16  0.0  0.0      0     0 ?        S<    2014   0:00 [kacpid]
root        60  0.0  0.0      0     0 ?        S<    2014   0:00 [cqueue/0]
root      1262  0.0  0.1  10128   576 ?        Ss    2014   0:01 syslogd -m 0
root      1265  0.0  0.0   3824   288 ?        Ss    2014   0:00 klogd -x
nscd      1274  0.0  0.1 129572   952 ?        Ssl   2014   0:09 /usr/sbin/nscd
root      1294  0.0  0.1  62648   768 ?        Ss    2014   0:00 /usr/sbin/sshd
ntp       1307  0.0  1.0  19428  5120 ?        SLs   2014   0:02 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
root      1331  0.0  0.2  74828  1152 ?        Ss    2014   0:00 crond
root      1336  0.0  0.0  31628    68 ?        Ssl   2014   0:00 /usr/sbin/gshelld
root      1345  0.0  0.1   3808   520 tty1     Ss+   2014   0:00 /sbin/mingetty tty1
root      1346  0.0  0.1   3808   520 tty2     Ss+   2014   0:00 /sbin/mingetty tty2
root      2903  0.0  1.8 286532  9352 ?        Sl    2014  15:56 /usr/local/aegis/alihids/AliHids
root      3480  0.0  0.3  77528  1944 ?        Ss   Jan05   0:00 SCREEN -S anders.zhangw
root      3481  0.0  0.3  66084  1592 pts/3    Ss+  Jan05   0:00 /bin/bash
root      3493  0.0  0.3  66184  1644 pts/4    Ss+  Jan05   0:00 /bin/bash
root      3505  0.0  0.3  66084  1584 pts/5    Ss+  Jan05   0:00 /bin/bash
root      7527  0.0  0.3  77208  1736 ?        Ss    2014   0:00 SCREEN -S anders.zhangw
root      7528  0.0  0.3  66084  1576 pts/1    Ss+   2014   0:00 /bin/bash
root      7540  0.0  0.3  66084  1572 pts/2    Ss+   2014   0:00 /bin/bash
root     12893  0.0  0.0      0     0 ?        S    Jan16   0:00 [pdflush]
root     12895  0.0  0.0      0     0 ?        S    Jan16   0:00 [pdflush]
root     15075  0.0  0.6  88080  3316 ?        Ss   16:50   0:00 sshd: root@pts/0
root     15079  0.0  0.3  66088  1600 pts/0    Ss   16:50   0:00 -bash
root     15105  0.0  0.1  65608   988 pts/0    R+   16:54   0:00 ps axu
那么,进程的状态都表示些什么意思?

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

现在,我们可以详细讨论下Linux进程的状态变化。。。。突然有人叫吃饭,那就吃饭后继续额
                   


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-41915-1-1.html 上篇帖子: Linux之ctime atime mtime区分 下篇帖子: find命令使用详解 Linux
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表