• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pstree Command Examples in Linux

by admin

pstree command is used to display the parent-child relationship in a hierarchical format. The output of this command is quite similar to the output of the ‘ps axjf’ command and the ‘ps -ef –forest’ command, as shown in the following command line:

$ pstree

The following screenshot displays the tree hierarchy of a single process with PID using the pstree command:

pstree Command Examples in Linux

Display the tree hierarchy of a user’s processes by executing the command line given:

$ pstree -p geek

On execution of the preceding command, the PIDs assigned to each process are shown in parentheses after each process name.

pstree Command Example

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 

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Disable TLS 1.1 Cockpit port 9090
  2. mkfs.exfat: command not found
  3. Beginners guide to vi editor (command line reference)
  4. The locate Command in Linux
  5. How to use strace and ltrace commands in Linux
  6. lslogins Command Examples in Linux
  7. How to Add a 3rd Disk to Create a 3-way Mirror RAID1 MD Device (CentOS/RHEL 7)
  8. How to Check the Size of the Yum Channels in Oracle Linux
  9. bmon: command not found
  10. lpr: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright