pmap and pstree can let us view the memory map f the process
or show processes as a tree.
Options
pmap Command Options
Here are some options for pmap command:
Option |
Description |
-x or ‑‑extended |
Displays the extended format. |
-d or ‑‑device |
Displays the format of the device. |
-q or ‑‑quiet |
Hide headers and footers. |
-A or ‑‑range low,high |
Limits the lines of the specified memory addresses.
|
-X |
Displays more information than the -x option.
|
-XX |
Displays all the information provided by the kernel.
|
-p or ‑‑show-path |
Displays the full name of the path to the file in the
mapping column.
|
pstree Command Options
Here are some options for pstree command:
Option |
Description |
-a |
Show command line arguments. |
-A |
Draw the tree with ASCII characters. |
-c |
Show all the same subtrees. |
-h |
Highlight the current process and its ancestors.
|
-g |
Display process group IDs, and if process IDs and group
IDs are displayed at the same time, process IDs are
first displayed.
|
-p |
Display process IDs. |
-u |
Display user IDs. |
-Z |
Display processes’ security contexts.
|
Examples
pmap
Show First Twenty Lines of pmap Process Content
1
2
|
# 1 is the process ID
pmap 1 | head -20
|
pstree
Show First Twenty Lines of pstree Content
Show Command Arguments With pstree
References
PMAP(1),
PSTREE(1)
Buy me a coffee