ps -eLo pid,tid,class,rtprio,ni,pri,psr,pcpu,pmem,stat,wchan:30,comm

线程相关选项:

THREAD DISPLAY
H Show threads as if they were processes -L Show threads, possibly with LWP and NLWP columns -T Show threads, possibly with SPID column m Show threads after processes -m Show threads after processes

状态的打印项含义:

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

-o 选项指定打印的项:

OBSOLETE SORT KEYS
These keys are used by the BSD O option (when it is used for sorting). The GNU --sort option doesn’t use these keys, but the specifiers
described below in the STANDARD FORMAT SPECIFIERS section. Note that the values used in sorting are the internal values ps uses and not the
"cooked" values used in some of the output format fields (e.g. sorting on tty will sort into device number, not according to the terminal name
displayed). Pipe ps output into the sort() command if you want to sort the cooked values. KEY LONG DESCRIPTION
c cmd simple name of executable
C pcpu cpu utilization
f flags flags as in long format F field
g pgrp process group ID
G tpgid controlling tty process group ID
j cutime cumulative user time
J cstime cumulative system time
k utime user time
m min_flt number of minor page faults
M maj_flt number of major page faults
n cmin_flt cumulative minor page faults
N cmaj_flt cumulative major page faults
o session session ID
p pid process ID
P ppid parent process ID
r rss resident set size
R resident resident pages
s size memory size in kilobytes
S share amount of shared pages
t tty the device number of the controlling tty
T start_time time process was started
U uid user ID number
u user user name
v vsize total VM size in kB
y priority kernel scheduling priority

其他,man ps可以查看。

用ps 查看线程状态的更多相关文章

  1. jstack 查看线程状态

    使用jstack pid命令可以查看JVM的线程状态,其中值得关注的线程状态有:死锁,Deadlock(重点关注)执行中,Runnable等待资源,Waiting on condition(重点关注) ...

  2. Linux下多线程查看工具(pstree、ps、pstack),linux命令之-pstree使用说明, linux 查看线程状态。 不指定

    0.最常用 pstree:[root@iZ25dcp92ckZ temp]# pstree -a|grep multe  |       |   `-multepoolser  |       |   ...

  3. 【java】jstack分析查看线程状态

    演示代码 public class StackTest { public static void main(String[] args) { Thread thread = new Thread(ne ...

  4. centos8:linux平台查看线程(ps/pstree/top)

    一,ps/pstree/top命令所属的rpm包 pstree所属的包 [root@blog ~]# whereis pstree pstree: /usr/bin/pstree /usr/bin/p ...

  5. 面试官:都说阻塞 I/O 模型将会使线程休眠,为什么 Java 线程状态却是 RUNNABLE?

    摘要: 原创出处 https://studyidea.cn 「公众号:程序通事 」欢迎关注和转载,保留摘要,谢谢! 使用 Java 阻塞 I/O 模型读取数据,将会导致线程阻塞,线程将会进入休眠,从而 ...

  6. Java线程状态及切换

    Java线程状态及切换 一.什么是Java线程状态 在Java程序中,用于描述Java线程的六种状态: 新建(NEW):当前线程,刚刚新建出来,尚未启动. 运行(RUNNABLE):当前线程,处于竞争 ...

  7. 10.6 监控io性能 10.7 free命令 10.8 ps命令 10.9 查看网络状态 10.10 linux下抓包

    iostat sysstat 包里面包括 sar 和 iostat [root@centos7 ~]# iostat Linux 3.10.0-693.2.2.el7.x86_64 (centos7. ...

  8. 监控io性能、free、ps命令、查看网络状态、Linux下抓包 使用介绍

    第7周第2次课(5月8日) 课程内容: 10.6 监控io性能 10.7 free命令10.8 ps命令10.9 查看网络状态10.10 linux下抓包扩展tcp三次握手四次挥手 http://ww ...

  9. JVM探秘:jstack查看Java线程状态

    本系列笔记主要基于<深入理解Java虚拟机:JVM高级特性与最佳实践 第2版>,是这本书的读书笔记. jstack命令可以打印Java进程的各个线程堆栈跟踪信息,可以用来查看Java中各个 ...

随机推荐

  1. P多行溢出省略号的处理

    因为-webkit-line-clamp: 2不兼容火狐或IE,采用判断浏览器的方式来启用哪个方式 先判断是什么浏览器 //判断是否是谷歌浏览器 if (!stripos($_SERVER[" ...

  2. SSH自动登录config文件配置

    title: SSH自动登录config文件配置 comments: false date: 2019-08-19 19:29:13 description: 更方便的 ssh 操作??? categ ...

  3. Bootstrap4中栅格系统CSS中 col-sm-* col-md-* col-lg-*的意义以及当其同时具有col-xs-* col-sm-* col-md-* col-lg-*的含义

    根据Bootstrap--Grid 中 col-sm-* col-md-* col-lg-* col-xl-*的意义: .col-sm-* 小屏幕 手机 (≥ 576px) .col-md-* 中等屏 ...

  4. 聚类算法博客 K-means算法

    最近看到一个 blog 感觉超好.记录下.. http://blog.pluskid.org/?p=17

  5. Django学习系列2:django环境中安装selenium并查看selenium版本号

    在Django环境中安装selenium (django) root@ranxf-TEST:/studydisk/Python_web_TDD/superlists# conda install se ...

  6. C#基础知识之图解TCP IP》读书笔记

    一.网络基础知识 1. 计算机使用模式的演变 2.协议 协议就是计算机与计算机之间通过网络实现通信事先达成的一种“约定”.这种“约定”使那些由不同厂商的设备.不同的CPU以及不同的操作系统组成的计算机 ...

  7. CentOS6.X系统启动流程

    1.硬件启动阶段 BIOS自检  BIOS的功能由两部分组成,分别是POST码和Runtime服务.POST阶段完成后它将从存储器中被清除,而Runtime服务会被一直保留,用于目标操作系统的启动.B ...

  8. 【CF896C】Willem, Chtholly and Seniorious

    ODT模板题,ODT适合随机数据下具有维护区间推平操作的序列维护题目,时间复杂度较为玄学.. 代码如下 #include <bits/stdc++.h> #define pb push_b ...

  9. Python 日期和时间Ⅱ

    获取某月日历 Calendar模块有很广泛的方法用来处理年历和月历,例如打印某月的月历: 以上实例输出结果: Time 模块 Time 模块包含了以下内置函数,既有https://www.xuanhe ...

  10. shell练习--PAT试题1009:说反话 (20 分)

    给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出. 输入格式: 测试输入包含一个测试用例,在一行内给出总长度不超过 80 的字符串.字符串由若干单词和若干空格组成,其中单词是由英文字母(大小 ...