Priority & Background Jobs

Nice Values (Priority)

Nice ranges from -20 (highest priority) to +19 (lowest). Only root can set negative values.

$ nice -n 10 ./batch.sh      # start with lower priority
$ renice -n 5 -p 1234        # change a running process

Job Control

CommandAction
cmd &Start in background
Ctrl+ZSuspend current job
jobsList shell jobs
bg %1Resume job 1 in background
fg %1Bring job 1 to foreground
nohup cmd &Survive logout
disownDetach from shell
Exam tip: nohup + & (or disown) keeps a job running after the terminal closes because it ignores SIGHUP.