So What Is a Process, Anyway?
All the work UNIX does for you is done by UNIX processes. When you log in, the shell is a process. When you run an editor, the editor is a process. Pretty much any command you run is a process.Processes called daemons lurk in the background and wait to do useful things without manual intervention. When you use lp or lpr to print something, for example, a daemon does the real work of sending the material to the printer.Normally, all this process stuff happens automatically, and you don’t have to pay much attention to it. Sometimes a program gets stuck, however, and you can’t make it go away. If you use a personal computer running Windows 98 or a pre-OS X Macintosh, the usual response to a stuck program is to restart the computer. When you run UNIX, resetting the computer is a little extreme for a single stuck program. For one thing, other running programs and other people who are logged in do not appreciate having their computer kicked out from underneath them. Also, UNIX may take awhile to restart from a forced reboot (our system takes about 5 minutes to check all the hard drive), and you run the risk of losing files that were being updated.Technical Stuff Why processes are not programs and vice versa
Although programs and processes are similar, they’re not the same. A process is, more or less, a running program. Suppose that you’re using X Windows, have two windows on-screen, and are running vi in both of them. Although the same program is running in both windows, they’re different processes doing different things (in this case, editing different files).To add to the confusion, some programs use more than one process apiece. The terminal program cu , for example, uses two processes: one to copy what you type to the remote computer and the other to copy stuff from the remote computer back to your screen. Sometimes, hidden processes take place: Many programs have a way you can execute any UNIX command from inside the program. (In vi and ed , for example, you type ! and the command you want to run.) In addition to the command, a shell process usually interprets the command.In most cases, identifying in a list of processes which one is which is easy because each one is identified by the command that started it.