English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux pstree Command

Linux Command大全

The Linux pstree command displays all processes in a tree diagram, the tree diagram will be rooted at pid (if specified) or at the basic process init, if a specified user id is specified, the tree diagram will only display the processes owned by the user.

Usage Permission: All Users.

Syntax

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

or

pstree -V

Parameter Description:

  • -a Display the complete command and parameters of the process, if the process is swapped out of memory, it will be added with parentheses
  • -If there are duplicate process names, they will be listed separately (the default value is to be added in front of it) *)

Online Examples

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
....

Especially Indicate the Running Processes

# pstree -apnh //Display Relationships Between Processes

Display User Name at the Same Time

# pstree -u //Display User Name

Linux Command大全