Unix Processes & Job Control
Essay Preview: Unix Processes & Job Control
Report this essay
Unix processes are instances of an executed program. UNIX, being a multi task operating system handles thousands of processes at a time. We are able to check on what processes are currently running by typing ps at the UNIX prompt. Depending on the options used with the ps command, we can see different outcomes such as $ps -ef | more. This will list all the processes in the system. Some items you might see using the ps command are PID which is the process ID number, TT or TTY shows the controlling terminal for the process. If there is no controlling terminal then a question mark is used.
o – Process is running on a processor
s — Sleeping: process is waiting for an event to complete
r – run-able: process is on run queue.
z – Zombie state: process terminated and parent not waiting.
t – Process is stopped, either by a job control signal or because it is being traced.
To kill a process you could type kill 101. The 101 would be the pid (process ID) number. If the process gets hung and doesn’t listen to this kill command, you can also type kill -9 101. The -9 pulls the plug, this command is not recommended because it can leave some locked files or child processes behind. Kill -l provides a quick look at available signals, names and pids
Job control is the process of running job processes in your current shell, in your current login session. There are several shell commands you can use to manipulate these jobs even though you close your session or current shell. Jobs may continue to run. This is why there are commands to manipulate any process you might have left behind.
You can start a job in either the foreground or background. If you run a job in the background and then close your current shell, you cannot bring that job back to the foreground. But, that background job can continue to produce output to a file
To start a job in the foreground, type in the command at the UNIX prompt and hit return. There are two ways to start a job in the background. First, you can choose the command from your root menu or you can type in the command at the UNIX prompt followed by the ampersand &
Example: netscape &
To list the jobs type “jobs” at the