prev next prev next
  Course navigation
 
Lesson 3
Objective
What is a process?
Define a UNIX process
    Difference between a process and a program
The definition of a process depends on the difference between a process and a program. A program is a static entity--a file--that resides on the disk. An example is the /bin/ls program you use to list files in the current directory.
When you run a program, you create a process. In other words, a process is a running. I’m going to change this one back—the meaning is very specific here and I want to keep the original. Your version sounds better but is not precisely what I want to say.
program. If five users run the ls command, they create five processes. A process is an active entity in the memory and CPU of your machine. UNIX assigns a unique number to each process called a PID numberDo these number assignments only last as long as the process is running? Once a process is done running, does it no longer exist? In other words, can there only be said to be a process during the actual time that it is running? Is there are way or any need to access what that pid number is for each process as it is running?this is covered later in the course
. When the process completes, the PID number is reclaimed and can be used again when another process is started.
When you login to your shell account, UNIX starts a shell process for you.

This shell process
Should this word say program or process? You said process in the last sentence, so I am confused.
oops
is printing the dollar sign prompt you see on the screen and runs your commands as you type them in. You use the ps command to see a list of the processes you are currently running on the system. You should see your shell listed in the outputWhy—is the shell itself a process?
ok
since it is a process. When you run a shell script, UNIX will create a new shell process with a new PID number.
The following MouseOver shows a sample ps command and its output. In this example, the user is running only the Bourne shell (the /bin/sh program), which is displayed as sh.
The next lesson describes how to start a new interactive shell.
  Course navigation