PSTREE(1) User Commands PSTREE(1)
名前
pstree - プロセスのツリーを表示する
書式
pstree [-a] [-c] [-h|-Hpid] [-l] [-n] [-p] [-u] [-G|-U] [pid|user]
pstree -V
説明
pstree は実行中のプロセスをツリー形式で表示する。ツリーは pid を起点と
する。 pid が省略されると init を起点とする。ユーザー名が指定されると、
そのユーザーのプロセスを起点とする全てのプロセスツリーを表示する。
同 じ内容の分岐があると、 pstree はそれらを [] で括り、繰り返し数を前に
付けてまとめる。例えば
init-+-getty
|-getty
|-getty
‘-getty
は
init---4*[getty]
となる。
オプション
-a コマンドラインの引数を表示する。プロセスのコマンドラインがスワッ
プ ア ウトされているときは、そのプロセスを括弧で括って表示する。
-a は暗黙の内に [] によるまとめ表示を無効にする。
-c 同じ内容のサブツリーをまとめない。デフォルトでは、可能な限り常に
同内容のサブツリーをまとめる。
-G VT100 の 罫線文字 (line drawing character) を使う。
-h カレントプロセスとその先祖のプロセスを強調表示する。ターミナルが
強調表示をサポートしていなかったり、カレントプロセスとその上位グ
ループのいずれもがツリーに属していなければ、この指定は単に無効と
なる。
-H -h と似ているが、指定したプロセスを強調表示する。 -h とは違い 、
pstree は -H の強調表示ができない場合には失敗する。
-l 長い行を表示する。デフォルトでは、長い行はディスプレイの幅で打ち
切られる。出力が tty 以外に送られる場合や、ディスプレイの幅が 分
からない場合は 132 桁で打ち切られる。
-n 同じ親を持つプロセスどうしを、名前でなく PID でソートする。(数値
ソート)
-p PID を表示する。PID は10進数でプロセス名の後に括弧付で表示される
。 -p を付けると、ツリーのまとめ表示は行わない。
-u uid の遷移を表示する。プロセスの uid が親の uid と異なる時は、常
にその新しい uid がプロセス名の後に括弧付で表示される。
-U UTF-8 (Unicode) の罫線文字 (line drawing character) を 使 う 。
Linux 1.1-54 以降においては、コンソールは echo -e ’\033%8’ で
UTF-8 モードに入り、 echo -e ’\033%@’ で終了する。
-V バーション情報を表示する。
ファイル
/proc proc ファイルシステムの場所
著者
Werner Almesberger
PSTREE(1) User Commands PSTREE(1)
NAME
pstree - display a tree of processes
SYNOPSIS
pstree [-a] [-c] [-h|-Hpid] [-l] [-n] [-p] [-u] [-Z] [-A|-G|-U]
[pid|user]
pstree -V
DESCRIPTION
pstree shows running processes as a tree. The tree is rooted at either
pid or init if pid is omitted. If a user name is specified, all process
trees rooted at processes owned by that user are shown.
pstree visually merges identical branches by putting them in square
brackets and prefixing them with the repetition count, e.g.
init-+-getty
|-getty
|-getty
‘-getty
becomes
init---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.
icecast2---13*[{icecast2}]
If pstree is called as pstree.x11 then it will prompt the user at the
end of the line to press return and will not return until that has hap-
pened. This is useful for when pstree is run in a xterminal.
Certain kernel or mount parameters, such as the hidepid option for
procfs, will hide information for some processes. In these situations
pstree will attempt to build the tree without this information, showing
process names as question marks.
OPTIONS
-a Show command line arguments. If the command line of a process is
swapped out, that process is shown in parentheses. -a implicitly
disables compaction.
-A Use ASCII characters to draw the tree.
-c Disable compaction of identical subtrees. By default, subtrees
are compacted whenever possible.
-G Use VT100 line drawing characters.
-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 Like -h, but highlight the specified process instead. Unlike
with -h, pstree fails when using -H if highlighting is not
available.
-l Display long lines. By default, lines are truncated to the dis-
play width or 132 if output is sent to a non-tty or if the dis-
play width is unknown.
-n Sort processes with the same ancestor by PID instead of by name.
(Numeric sort.)
-p Show PIDs. PIDs are shown as decimal numbers in parentheses
after each process name. -p implicitly disables compaction.
-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 Use UTF-8 (Unicode) line drawing characters. Under Linux 1.1-54
and above, UTF-8 mode is entered on the console with echo -e
’\033%8’ and left with echo -e ’\033%@’
-V Display version information.
-Z (SELinux) Show security context for each process.
FILES
/proc location of the proc file system
AUTHORS
Werner Almesberger
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa