The command
ps –f
lists all of the processes you are currently running. The
–f
displays a full list of information.
This information includes the PID of the parent process, which is referred to as the PPID in the
ps
command output.
Look at the sample
ps –f
command below. It reflects the processes created in the series of images above. Connecting lines are included in the command below to point out the relationship between the PID and PPID numbers. These lines are not normally part of the output, they are just used here for clarification.
parentchild_010gr
In the listing above, the /bin/ksh process (PID 3723) was started from the /bin/sh process (PID 3707), so 3707 is listed as the PPID of 3723.
The /bin/csh process (PID 3725) was started from the /bin/ksh process (PID 3723), so 3725 is listed as the PPID of 3725.
The next lesson examines three different techniques for running a shell script.