Parent and Child Processes

In the ps -f example in the ps command section, each process has two ID numbers assigned to it: process ID (pid) and parent process ID (ppid). Each user process in the system has a parent process. Most commands that you execute have the shell as their parent. The parent of your shell is usually the operating system or the terminal communications process (for example, in.telnetd for telnet connections).

If you examine the output of ps –ef, you see that the parent process of all your commands is 3662, the pid of the login shell (in this ksh):

 $ ps -f UID PID PPID C STIME TTY TIME CMD dhorvath 6738 3662 0 10:23:03 pts/6 0:00 first_one dhorvath 6739 3662 0 10:22:54 pts/6 0:00 second_one dhorvath 3662 3657 0 08:10:53 pts/6 ...

Get Sams Teach Yourself Shell Programming in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.