当前位置: 技术问答>linux和unix
帮满解释一下ps的输出格式
来源: 互联网 发布时间:2016-10-01
本文导语: 帮忙解释一下每个字段都是什么意思。手册里并没有提及。 ps -l F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 4 S 0 2677 2675 0 85 10 - 666 wait pts/0 00:00:00 bash 0 R ...
帮忙解释一下每个字段都是什么意思。手册里并没有提及。
ps -l
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
4 S 0 2677 2675 0 85 10 - 666 wait pts/0 00:00:00 bash
0 R 0 2732 2677 0 87 10 - 499 - pts/0 00:00:00 ps
ps -ly
S UID PID PPID C PRI NI RSS SZ WCHAN TTY TIME CMD
S 0 2677 2675 0 85 10 1544 666 wait pts/0 00:00:00 bash
R 0 2733 2677 0 86 10 684 499 - pts/0 00:00:00 ps
|
wchan WCHAN name of the kernel function in which the process is sleeping, a "-" if the process is running, or a "*" if
the process is multi-threaded and ps is not displaying threads.
sz SZ size in physical pages of the core image of the process. This includes text, data, and stack space. Device
mappings are currently excluded; this is subject to change. See vsz and rss.
rss RSS resident set size, the non-swapped physical memory that a task has used (in kiloBytes). (alias rssize, rsz).
ni NI nice value. This ranges from 19 (nicest) to -20 (not nice to others), see nice(1). (alias nice).
这些都是man ps看到的..
|
PROCESS FLAGS
The sum of these values is displayed in the "F" column, which is provided by the flags output specifier.
1 forked but didn't exec
4 used super-user privileges
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: