Next: Batch jobs and Calendar
Up: The Shell (csh, tcsh,
Previous: Command history (history)
  Contents
Since UNIX is a multi-tasking operating system, you can run
several commands at once. All shells except the Bourne shell allow
you to inquire about, stop, or bring to the foreground any job you
have started.
To find out about the jobs you have, type jobs. You will
get a message like the following:
malama% jobs
[1] - Stopped vi params
[2] + Stopped talk manson
malama%
The ``[n]'' is the job number. The plus sign, corresponding to
job two, means this is the current job. A minus sign indicates the
next job. The message ``stopped'' implies that the job is currently
suspended and is waiting until you call it up. Other possibilities
are ``running'', if the job is running in the background, or ``tty
input'' if it is waiting get input from the terminal. In the latter
case, bring the job into the foreground and type whatever is
necessary. Note that you may not get a prompt which you would have had
if the job had been running in the foreground all along.
- To access a job type fg %n, fg [n],
or, for the C-shells, just %n, where ``n'' is the job number.
- To terminate a job use the kill command. Just
type kill %n. If you have trouble killing one of your
processes using plain kill, you can destroy it with kill
-9 followed by either the job number (if it was started by your
login session) or by the process ID. You can find out the ID numbers
of the processes you own with the command ps.
- If you have a job running and for some reason you
wish to exit temporarily from it, type ctrl-Z. The system
will create a stopped job like the ones above. To resume it type
fg (for foreground). If you want to keep it running while
you do something else, type bg immediately after the
ctrl-Z. UNIX is very sensitive about stopped jobs. If you have
stopped jobs and try to log out the system will not allow you to.
You must finish or background all jobs before logging out.
Next: Batch jobs and Calendar
Up: The Shell (csh, tcsh,
Previous: Command history (history)
  Contents
h.stilmack@jach.hawaii.edu