Forrest logo
back to the ps tool

ps:tldr:37b43

ps: Get the parent PID of a process.
$ ps -o ppid= -p ${pid}
try on your machine

This command, "ps -o ppid= -p ${pid}", is used to display the parent process ID (PPID) of a specific process with the provided process ID (pid).

Let's break down the command:

  • "ps": It is a command in Unix-like operating systems that is used to report a snapshot of the current processes running on a system.

  • "-o ppid=": The "-o" flag is used to specify the output format of the command. Here, "ppid=" specifies that we want to display only the PPID of processes. The "=" sign is used to suppress the column header.

  • "-p ${pid}": The "-p" flag is used to specify the process ID that we are interested in. "${pid}" is a placeholder for the actual process ID value.

So combining all the components, when you execute the command with a specific process ID like "ps -o ppid= -p 1234", it will display the PPID of the process with the ID 1234.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ps tool