Last Updated: February 25, 2016
·
867
· sheerun

List all process' PPIDs

Function:

ppids(){ echo $1; ppid=$(ps -o ppid= $1) && ppids ${ppid// /} || true; }

Usage:

ppids $$ | xargs ps # current process
ppids 42 | xargs ps # other process