Skip to Content
Small, Sharp Software Tools
book

Small, Sharp Software Tools

by Brian P. Hogan
June 2019
Intermediate to advanced
328 pages
7h 27m
English
Pragmatic Bookshelf
Content preview from Small, Sharp Software Tools

Terminating Processes

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The VimL Primer

The VimL Primer

Benjamin Klein
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz

Publisher Resources

ISBN: 9781680507003Errata Page