Easy Tutorial
❮ Linux Comm Chsh Linux Comm Ext2Ed ❯

Linux pstree Command

Linux Command Manual

The Linux pstree (English full name: display a tree of processes) command displays all processes in a tree diagram. The tree diagram will be rooted at the specified PID (if provided) or at the init process as the base root. If a user ID is specified, the tree diagram will only show the processes owned by that user.

Usage permission: All users.

Syntax

pstree [-a] [-c] [-h|-Hpid] [-l] [-n] [-p] [-u] [-G|-U] [pid|user]

or

pstree -V

Parameter Description:

Example

Display process relationships:

pstree
init-+-amd
|-apmd
|-atd
|-httpd---10*[httpd]
%pstree -p
init(1)-+-amd(447)
|-apmd(105)
|-atd(339)
%pstree -c
init-+-amd
|-apmd
|-atd
|-httpd-+-httpd
| |-httpd
| |-httpd
| |-httpd
....

Highlight running processes:

# pstree -apnh //Display process relationships

Also display user names:

# pstree -u //Display user names

Linux Command Manual

❮ Linux Comm Chsh Linux Comm Ext2Ed ❯