How can I get the PID of a TERMINAL running a process with given PID? For example, I open a new terminal and run it a process, say “. / dbserver”, then I have the PID of the process using pidof dbServer, so I want the PID of the terminal that is running dbserver. bash.
How can I get the PID of a TERMINAL running a process with given
Share
The output of
ps -fincludes the parent PID of each process. You could also use-o ppidalong with whichever other fields you are interested in.