Walk your own lineage upwards
Walk your own lineage upwards
Answer
ps -o pid,ppid,comm -p $$ pstree -p 1 | head -5
$$ is your shell’s PID. Follow the PPID chain and every process on the machine arrives at PID 1.
S&K 3e ch10 §10.7; ch7 for the awk stage