263 lines
6.4 KiB
HTML
263 lines
6.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of PSTREE</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>PSTREE</H1>
|
|
Section: User Commands (1)<BR>Updated: 2019-10-23<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
pstree - display a tree of processes
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
<B>pstree</B>
|
|
|
|
[<B>-a</B>,<B> --arguments</B>]
|
|
|
|
[<B>-c</B>,<B> --compact-not</B>]
|
|
|
|
[<B>-C</B>,<B> --color </B><I>attr</I><B></B>]
|
|
|
|
[<B>-g</B>,<B> --show-pgids</B>]
|
|
|
|
[<B>-h</B>,<B> --highlight-all</B>,<B> -H</B><I>pid</I><B>,</B> --highlight-pid <I>pid</I><B>]</B>
|
|
|
|
[<B>-l</B>,<B> --long</B>]
|
|
|
|
[<B>-n</B>,<B> --numeric-sort</B>]
|
|
|
|
[<B>-N</B>,<B> --ns-sort </B><I>ns</I><B></B>]
|
|
|
|
[<B>-p</B>,<B> --show-pids</B>]
|
|
|
|
[<B>-s</B>,<B> --show-parents</B>]
|
|
|
|
[<B>-S</B>,<B> --ns-changes</B>]
|
|
|
|
[<B>-t</B>,<B> --thread-names</B>]
|
|
|
|
[<B>-T</B>,<B> --hide-threads</B>]
|
|
|
|
[<B>-u</B>,<B> --uid-changes</B>]
|
|
|
|
[<B>-Z</B>,<B> --security-context</B>]
|
|
|
|
[<B>-A</B>,<B> --ascii</B>,<B> -G</B>,<B> --vt100</B>,<B> -U</B>,<B> --unicode</B>]
|
|
|
|
[<B></B><I>pid</I><B></B>,<B> </B><I>user</I><B>]</B>
|
|
|
|
<BR>
|
|
|
|
<B>pstree</B>
|
|
|
|
-V<B>,</B> --version
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>pstree</B>
|
|
|
|
shows running processes as a tree. The tree is rooted at either
|
|
<I>pid</I>
|
|
|
|
or
|
|
<B>init</B>
|
|
|
|
if
|
|
<I>pid</I>
|
|
|
|
is omitted. If a user name is specified, all process trees rooted at
|
|
processes owned by that user are shown.
|
|
<P>
|
|
|
|
<B>pstree</B>
|
|
|
|
visually merges identical branches by putting them in square brackets
|
|
and prefixing them with the repetition count, e.g.
|
|
<PRE>
|
|
|
|
init-+-getty
|
|
|-getty
|
|
|-getty
|
|
`-getty
|
|
|
|
</PRE>
|
|
|
|
becomes
|
|
<PRE>
|
|
|
|
init---4*[getty]
|
|
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
<P>
|
|
|
|
Child threads of a process are found under the parent process and are
|
|
shown with the process name in curly braces, e.g.
|
|
<PRE>
|
|
|
|
icecast2---13*[{icecast2}]
|
|
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
If
|
|
<B>pstree</B>
|
|
|
|
is called as
|
|
<B>pstree.x11</B>
|
|
|
|
then 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 for when
|
|
<B>pstree</B>
|
|
|
|
is run in a xterminal.
|
|
<P>
|
|
|
|
Certain kernel or mount parameters, such as the hidepid option for procfs,
|
|
will hide information for some processes. In these situations
|
|
<B>pstree</B>
|
|
|
|
will attempt to build the tree without this information, showing process
|
|
names as question marks.
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-a</B><DD>
|
|
Show command line arguments. If the command line of a process is
|
|
swapped out, that process is shown in parentheses.
|
|
<B>-a</B>
|
|
|
|
implicitly disables compaction for processes but not threads.
|
|
<DT id="2"><B>-A</B><DD>
|
|
Use ASCII characters to draw the tree.
|
|
<DT id="3"><B>-c</B><DD>
|
|
Disable compaction of identical subtrees. By default, subtrees are
|
|
compacted whenever possible.
|
|
<DT id="4"><B>-C</B><DD>
|
|
Color the process name by given attribute. Currently <B>pstree</B>
|
|
only accepts <I>age</I> which colors by process age.
|
|
Processes newer than 60 seconds are green,
|
|
newer than an hour yellow and the remaining red.
|
|
<DT id="5"><B>-g</B><DD>
|
|
Show PGIDs. Process Group IDs are shown as decimal numbers in
|
|
parentheses after each process name.
|
|
<B>-g</B>
|
|
|
|
implicitly disables compaction. If both PIDs and PGIDs are displayed
|
|
then PIDs are shown first.
|
|
<DT id="6"><B>-G</B><DD>
|
|
Use VT100 line drawing characters.
|
|
<DT id="7"><B>-h</B><DD>
|
|
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.
|
|
<DT id="8"><B>-H</B><DD>
|
|
Like
|
|
<B>-h</B>,
|
|
|
|
but highlight the specified process instead. Unlike with
|
|
<B>-h</B>,
|
|
|
|
<B>pstree</B>
|
|
|
|
fails when using
|
|
<B>-H</B>
|
|
|
|
if highlighting is not
|
|
available.
|
|
<DT id="9"><B>-l</B><DD>
|
|
Display long lines. By default, lines are truncated to either the COLUMNS
|
|
environment variable or the display width. If neither of these methods work,
|
|
the default of 132 columns is used.
|
|
<DT id="10"><B>-n</B><DD>
|
|
Sort processes with the same ancestor by PID instead of by name.
|
|
(Numeric sort.)
|
|
<DT id="11"><B>-N</B><DD>
|
|
Show individual trees for each namespace of the type specified. The
|
|
available types are: ipc, mnt, net, pid, user, uts. Regular users don't
|
|
have access to other users' processes information, so the output will be
|
|
limited.
|
|
<DT id="12"><B>-p</B><DD>
|
|
Show PIDs. PIDs are shown as decimal numbers in parentheses after each
|
|
process name.
|
|
<B>-p</B>
|
|
|
|
implicitly disables compaction.
|
|
<DT id="13"><B>-s</B><DD>
|
|
Show parent processes of the specified process.
|
|
<DT id="14"><B>-S</B><DD>
|
|
Show namespaces transitions. Like -N, the output is limited when running
|
|
as a regular user.
|
|
<DT id="15"><B>-t</B><DD>
|
|
Show full names for threads when available.
|
|
<DT id="16"><B>-T</B><DD>
|
|
Hide threads and only show processes.
|
|
<DT id="17"><B>-u</B><DD>
|
|
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.
|
|
<DT id="18"><B>-U</B><DD>
|
|
Use UTF-8 (Unicode) line drawing characters. Under Linux 1.1-54 and
|
|
above, UTF-8 mode is entered on the console with
|
|
<B>echo -e '\033%8'</B>
|
|
|
|
and left with
|
|
<B>echo -e '\033%@'</B>
|
|
|
|
<DT id="19"><B>-V</B><DD>
|
|
Display version information.
|
|
<DT id="20"><B>-Z</B><DD>
|
|
(SELinux) Show security context for each process. This flag will only
|
|
work if pstree is compiled with SELinux support.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="21">/proc<DD>
|
|
location of the proc file system
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
Some character sets may be incompatible with the VT100 characters.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ps">ps</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+top">top</A></B>(1).
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="22"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="23"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="24"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="25"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="26"><A HREF="#lbAF">FILES</A><DD>
|
|
<DT id="27"><A HREF="#lbAG">BUGS</A><DD>
|
|
<DT id="28"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:25 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|