pstree outputs a pseudographic overview of all or specific POSIX processes, showing the parent, child, and sibling relationships of the processes.
By default, only the POSIX administrator (superuser) is allowed to execute pstree.
If other users should also be allowed to execute pstree, the POSIX administrator can allow these users to execute "sudo pstree ..." (see sudo, sudoers).
Alternatively, after installing POSIX-BC, the POSIX administrator can assign the S-bit to the command (using: chmod +s /sbin/pstree), which allows all users to execute pstree.
Syntax
pstree[ -p pid] |
No option specified pstree outputs the entire process tree, which shows the parent, child, and sibling relationships of the processes.
Only those parts of the process tree are output that contain the process with the process number pid, its parent processes, or its child processes.
|
Output
Each output line consists of the following parts: prefix A pseudo-graphic string that visualizes parent, child, and sibling relationships. PID Process ID: A 5-digit decimal number with leading zeros. TSN BS2000 TSN of the process: A 4-digit alphanumeric string that begins with a number for user tasks and with a letter for system tasks. UID Username of the process: An 8-character string, possibly padded with spaces. CMD Command (program) that is executed in the process: A variable-length string, as displayed by the command ps -o args. If the standard output stdout is a terminal, the length of the output line is limited to the window width of the terminal. |
Error
The process with PID n specified by the -p option does not exist (anymore).
The caller is not the superuser. |
Locale
The following environment variables affect the execution of ps: LANG Provide a default value for the internationalization variables that are unset or null. If LANG is unset of null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined. |
Example 1
Output of the entire process tree:
|
Example 2
Output of the parts of the process tree that contain the process with process ID 121, its parent processes, or its child processes:
|
See also
| ps, top |