So, we have the job ID, process ID, foreground, and background processes, but how do we control these jobs? We have a bunch of commands available, let's have a look at how to use them:
- kill: We can pass the job ID to this command, which will send the SIGTERM signal to all the processes belonging to the job itself:
zarrelli:~$ sleep 100 & 9909zarrelli:~$ kill %1zarrelli:~$ + Terminated sleep 100
You can also pass to kill a specific signal to send to the process. For instance, kill -15 will nicely terminate a process with a SIGTERM signal, and if it refuses to die, kill -9 will send a SIGKILL, which will instantly terminate a process. Which signals can we send to a process? Either kill -l or cat /usr/include/asm-generic/signal.h ...