System Interface Guide

Overview

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. Take the option of invoking the shell from vi. Execute the ps command and you will see a display resembling this (which shows the results of a ps -f command):

UID

PID

PPID

C

STIME

TTY

TIME

COMD

abc

24210

1

0

06:13:14

tty29

0:05

-sh

abc

24631

24210

0

06:59:07

tty29

0:13

vi c2

abc

28441

28358

80

09:17:22

tty29

0:01

ps -f

abc

28358

24631

2

09:15:14

tty29

0:01

sh -i

User abc has four processes active. The process ID (PID) and parent process ID (PPID) columns show that the shell 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 may need to run one or more other programs based on conditions it encounters. Reasons that it might not be practical 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.