pstree(1) - man
page
Name
pstree- display a tree of
processes
# 注释 :pstree
用于显示一个总的进程树
Synopsis
pstree[-a] [-c]
[-h|-Hpid] [-l] [-n] [-p] [-u] [-Z] [-A|-G|-U] [pid|user]
pstree-V
Description
pstreeshows running processes as a tree. The tree is
rooted at eitherpidorinitifpidis omitted. If a user name is
specified, all process trees rooted at processes owned by that user are
shown.
# 注释 :pstree
显示正在运行的进程树。该进程树的顶点可以是你给定的某个 或者是 init 进程(默认)
#
如果你指定了一个用户名,则只显示进程树顶点的进程是由指定用户所拥有的部分
pstreevisually merges identical branches by putting
them in square brackets and prefixing them with the repetition count,
e.g.
# 注释 :pstree 会把某些重复的行合并为一个,并把它们放在 []
中,前面加上数量
init-+-getty
|-getty
|-getty
'-getty
becomes
# 注释 :表示有4个 getty
进程
Child threads of a process are
found under the parent process and are shown with the process name in curly
braces, e.g.
# 注释
:一个进程的子线程会按照下面的格式显示,前面加上父进程的名称,后面是 '数量*[线程名称]'
# 补充
:实际并不是象下面的一样把线程名放在 { } 中,例如
[n7css@monitor n7css]$
pstree
init-+-bdflush
|-crond-+-crond---mrtg---get_bkdata1-2_i---auto_bkdata1-2_---telnet
| |-crond---mrtg---get_db2_cpu_inf---auto_db2_cpu_in---telnet
| |-crond---mrtg---get_oradata1_io---auto_oradata1_i---telnet
| `-crond---mrtg---su---ssh
|-gpm
|-httpd---7*[httpd]
icecast2---13*[{icecast2}]
Ifpstreeis called aspstree.x11then it will prompt the user at the end of
the line to press return and will not return until that has happened. This is
useful whenpstreeis run in a xterminal.
# 注释 :假如 pstree 以 pstree.x11
名称被调用,则它会在结束时提示用户按 return ,然后停止不动。
# 这在 pstree 在一个 x
终端上运行时有用
# 补充 :redhat 上没有 pstree.x11
Options
- -a
- Show command line arguments.
If the command line of a process is swapped out, that process is shown in
parentheses.-aimplicitly disables compaction.
-
- # 注释 :-a
表示显示命令行的参数。如果进程已经被换出内存,则把它放在 ()中。-a
默认禁止上面的合并功能,会显示每个相同进程/线程
- -A
- Use ASCII characters to draw
the tree.
# 注释 :-A 表示使用
ASCII 字符来绘制进程树
- -c
- Disable compaction of
identical subtrees. By default, subtrees are compacted whenever
possible.
# 注释 :-c
表明明确禁止合并功能。
- -G
- Use VT100 line drawing
characters.
# 注释 :-G 表示使用
VT100 来绘制进程树
- -h
- Highlight the current process
and its ancestors. This is a no-op if the terminal doesn't support highlighting
or if neither the current process nor any of its ancestors are in the subtree
being shown.
# 注释 :-h
表示高亮当前进程和它的父进程。不过这需要终端具备该功能。默认是“高亮白色”
- -H
- Like-h, but highlight
the specified process instead. Unlike with-h,pstreefails when using-Hif highlighting is
not available.
# 注释 :-H 和 -h
类似,但高亮指定进程。不像 -h ,pstree -H 在终端不支持时会报错,而使用 -h 则不会
- -l
- Display long lines. By
default, lines are truncated to the display width or 132 if output is sent to a
non-tty or if the display width is unknown.
# 注释 :-l 表示显示
long lines 。默认行会被截断,只显示前 132 个字符(如果是非 tty 终端),不过它要配合 -a 才有用
- -n
- Sort processes with the same
ancestor by PID instead of by name. (Numeric sort.)
# 注释 :-n 表示按照
PID 排序而不是进程名。
- -p
- Show PIDs. PIDs are shown as
decimal numbers in parentheses after each process name.-pimplicitly
disables compaction.
# 注释 :-P 表示显示
pid 。默认是不显示的。以10进制显示。
- -u
- Show uid transitions.
Whenever the uid of a process differs from the uid of its parent, the new uid is
shown in parentheses after the process name.
# 注释 :-u 表示如果子进程的 uid
不同于父进程的 pid ,则 uid/username 被放在 () 中。
# 例如 sshd 就是这样,原始的
sshd 是 root 的,但后续的可能是归各个连接的用户的。
|-sshd-+-2*[sshd---sshd(n7css)---bash]
- -U
- Use UTF-8 (Unicode) line
drawing characters. Under Linux 1.1-54 and above, UTF-8 mode is entered on the
console withecho -e '\033%8'and left withecho -e
'\033%@'
# 注释 :-U 表示使用
UTF-8 绘图。
- -V
- Display version
information.
- -Z
- (SELinux) Show security
context for each process.
Files
/proclocation of the proc file system
Authors
Werner Almesberger <> Craig Small <>
Bugs
Some character sets may be incompatible
with the VT100 characters.
See Also
(1),(1).
REFERENCED BY
(1)
阅读(545) | 评论(0) | 转发(0) |