Phùng Quang Phi
New member
Where is parent process ID in Linux?
Answer
How to get a parent PID (PPID) from a child’s process ID (PID) using the command-line. e.g.
ps -o ppid= 2072 returns 2061, which you can easily use in a script etc. ps -o ppid= -C foo gives the PPID of process with command foo . You can also use the old fashioned ps | grep : ps -eo ppid,comm | grep ‘[f]oo’ .
Answer
How to get a parent PID (PPID) from a child’s process ID (PID) using the command-line. e.g.
ps -o ppid= 2072 returns 2061, which you can easily use in a script etc. ps -o ppid= -C foo gives the PPID of process with command foo . You can also use the old fashioned ps | grep : ps -eo ppid,comm | grep ‘[f]oo’ .