Linux中的ps命令,用于查看进程状态信息。
其输出内容有很多列,每一列中又有很多字母或符号表示很多种不同意思。
先贴个例子:
MTLG>ps
PID Uid VSZ Stat Command
1 root 132 S /sbin/init
2 root RWN [ksoftirqd/0]
3 root SW< [events/0]
4 root SW< [khelper]
5 root SW< [kthread]
6 root SW< [kblockd/0]
7 root SW [pdflush]
8 root SW [pdflush]
9 root SW< [kswapd0]
10 root SW< [aio/0]
11 root SW [mtdblockd]
12 root SW< [bfin-spi-master]
13 root SW< [rd_silabs_wq]
14 root DW< [wr_silabs_wq]
15 root SWN [jffs2_gcd_mtd3]
22 root 396 S /bin/sh /root/focus.profile
23 root 32 S /bin/watchdogd -f -k 1 -w 5
30 root SW< [IR_State_Machin]
50 root 11606 S /root/focusapp
51 root 11606 S /root/focusapp
52 root 11606 S /root/focusapp
143 root 11606 S /root/focusapp
144 root 384 S sh -c ps < /dev/silabstty0 > /dev/silabstty0 2>&1
145 root 516 R ps
具体含义为:
字 段
USER
PID
%CPU
%MEM
VSZ
RSS
TTY
STAT
TIME
COMMAND
NI
PRI
PPID
WCHAN
其中关于状态信息的英文解释:
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
【引用】
1.ps命令输出字段的含义
http://blog.sina.com.cn/s/blog_5dc960cd0100ccoe.html
2.man ps
http://unixhelp.ed.ac.uk/CGI/man-cgi?ps
转载请注明:在路上 » 【整理】ps命令输出字段的含义