| Now that you have completed this chapter, you
should have a firm understanding of the following:
UNIX initiates, manages, and terminates
programs using system processes. When a program such as the sort
command or the vi editor starts, the operating system kernel assigns
it a unique Process Identification Number or PID. The kernel also
allocates CPU time and RAM space for the program to run. UNIX
processes are hierarchical similar to the UNIX file system. Every
process has a parent process except the init process, which is process
number one.
There are five types of system processes
on a UNIX system:
- Daemon - Processes started by
the UNIX Kernel
- Parent - The process that
spawned another
- Child - The process spawned
by the parent
- Orphan - Result of parent
process terminating before child returns
- Zombie - Child process which
does not return to the parent
The ps
command is used to display processes and has several options. The
command ps -ef
will display every process with full information.
- -e - Every process
- -f - Full listing of
information
- -u - User processes
The output of the ps
command can be piped to the more
command to see a screen at a time or to the grep
command to search for specific strings such as program names.
Long running or unresponsive processes
can be terminated using the kill
command and while specifying the PID of the process. Most processes can
be terminated with the basic kill
PID# command or soft kill. To
kill a shell process requires the kill
-9 PID# or sure kill command.
Computers have physical memory which is
known as Random Access Memory or RAM. During installation, the
UNIX operating system sets aside an area on the hard disk called swap
space. As programs are executed, they are copied from the hard
disk into system RAM and divide into pages. In order to make
the best use of RAM, portions of programs that have not been used
recently are paged out to the swap area of the hard disk. This allows
more programs to fit into RAM. If pages that are on the hard disk are
needed, they can be paged back into RAM. The combination of physical
RAM and the swap space on the hard disk is known as virtual
memory. |