Categories: LinuxUbuntu

How to Display PPIDs in Linux

In Linux, PPID refers to the process ID of the parent process. A parent process in Linux is the one that is capable of spawning child processes. A single parent process can have multiple child processes whereas a single child process can belong to one and only one parent process. In other words, multiple child processes can have the same PPID. In today’s tutorial, we want to show you the two methods of finding the parent process IDs or PPIDs in Linux.

Displaying PPIDs in Linux

For displaying the parent process IDs or PPIDs in Linux, you can choose any of the following two methods:

Method # 1: Using the “pstree” command

For displaying the PPIDs through the “pstree” command, you will have to execute it in the manner shown below:

$ pstree -p

When this command will be executed, it will display all the currently running parent processes and their child processes in a nice tree-like structure along with their respective IDs. The PPIDs are represented by the numbers on the first level of the hierarchy. For example, the PPID of the ModemManager parent process is 751 as shown in the following image:

Method # 2: Using the “ps” command

For displaying the PPIDs through the “ps” command, you will have to execute it in the manner shown below:

$ ps -ef

When this command will be executed, it will display all the currently running parent processes and some additional information about them in the form of an organized table along with their respective IDs. The PPIDs are displayed in the third column of the output. For example, the PPID of the /sbin/init splash process is 0 as shown in the following image:

Conclusion:

We shared with you the two different methods of displaying the parent process IDs or PPIDs in Linux. For following both of these methods, you are just supposed to run a one-liner command and you will be good to go.

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

Recent Posts

How to Install Magento 2 on AlmaLinux

Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…

1 year ago

How to Install ISPConfig Hosting Control Panel with Apache Web Server on Ubuntu 24.04

ISPConfig is an open-source control panel that allows users to manage multiple servers from a…

1 year ago

How to Test your Email Server (SMTP) Using the Telnet Command

As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…

1 year ago

Managing Network Interfaces and Settings on Ubuntu 24.04 with nmcli

Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…

2 years ago

Using Restic Backup on Ubuntu 24.04

Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…

2 years ago

Installing phpMyAdmin on Rocky Linux 9 and Securing it with Let’s Encrypt SSL

phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…

2 years ago