System Interface Guide


Executing a command starts a process that is numbered and tracked by the operating system. Processes are always generated by other processes. For example, log in to your system running a shell, then use an editor such as vi(1). Take the option of invoking the shell from vi(1). Execute ps(1) and you see a display resembling this (which shows the results of ps -f):

abc24210 1006:13:14tty290:05-sh
abc2463124210006:59:07tty290:13vi c2
abc28441283588009:17:22tty290:01ps -f
abc2835824631209:15:14tty290:01sh -i

User abc has four processes active. The process ID (PID) and parent process ID (PPID) columns show that the shell that started when user abc logged on is process 24210; its parent is the initialization process (process ID 1). Process 24210 is the parent of process 24631, and so on.

A program might need to run one or more other programs based on conditions it encounters. Reasons that you might not want to create one large executable include:

The fork(2) and exec(2) functions let you create a new process (a copy of the creating process) and start a new executable in place of the running one.