June 2019
Intermediate to advanced
328 pages
7h 27m
English
Every so often, a program misbehaves. Sometimes it’s due to something you configured incorrectly. Other times it’s because the program has a bug. You’ve probably experienced a stuck program before and figured out a way to kill the task using a graphical task manager. You can manage tasks from the command-line interface as well. All you need is the process ID.
Let’s start a long-running task in the background. In your terminal, execute this command:
| | $ sleep 9999999 & |
| | [1] 23841 |
This process is now running. Use the jobs -l command to list the running background jobs and show the process ID in addition to the job ID:
| | $ jobs -l |
| | [1]+ 23841 Running sleep 999999 & |
The kill command terminates processes by ...