how to use pstree command with its examples

The pstree command displays the running processes on a system in a tree format. Which also shows the hierarchical relationship between processes, with each process represented as a node in the tree.

  • About pstree: To display a tree of processes
  • Comes From: psmisc-22.6
  • Configuration Files:
  • Path: /usr/bin/pstree

Examples:

1. To display the process tree

$ pstree 2210

2. To show the command line arguments

$ pstree -a

 3. To Use ASCII characters to draw the tree

$ pstree -A

 4. To Disable compaction of identical subtrees

$ pstree -c

 5. To Use VT100 line drawing characters

$ pstree -G

 6. To Highlight the current process and its ancestors

$ pstree -h

 7. To highlight the specified process instead

$ pstree -H

 8. To Display  long lines

$ pstree -l

 9. To Sort processes with the same ancestor by PID instead of by name

$ pstree -n

 10. To show PIDs

$ pstree -p

 11. To show the uid transactions

$ pstree -u

 12. To Use UTF-8 (Unicode) line drawing characters

$ pstree -U

 13. To display the version

$ pstree -V

 14. To show the security context

$ pstree -Z

 Related Commands: ps, top 

Leave a Reply

Your email address will not be published. Required fields are marked *