next up previous contents
Next: Mail and messages Up: The Shell (csh, tcsh, Previous: Background jobs (&)   Contents

Priority (nice)

Since UNIX is a multitasking system it must have some way of organizing the commands it is expected to execute. It does this by giving each job a basic priority number, called the ``niceness''. The higher the nice value, the lower the command's scheduling priority (which is calculated based on the ``niceness'' and the job's behavior, i.e. how much I/O and CPU it requests). Normal interactive niceness is zero. When a job is niced, the default number is 10 and the highest number (i.e. the lowest priority) is 19. You can set the niceness by using the nice command. The format is:

nice [-number] command

Note, you can only increase the niceness value; you must be a superuser to decrease the value (i.e. raise the priority). You can use nice for either a foreground or background job, but it really only makes sense to use it with background ones. To change the ``niceness'' of a job after it has started, use the renice command.

Using the command nice with jobs is similar to submitting a low-priority batch job in VMS. The main differences are that UNIX does not record the priority at which a process ran, and there is (unfortunately) no real limit on who can run how many jobs this way.

truein


next up previous contents
Next: Mail and messages Up: The Shell (csh, tcsh, Previous: Background jobs (&)   Contents
h.stilmack@jach.hawaii.edu