Chapter 13. Process control

Table of Contents
13.1. More about processes
13.1.1. Process Tree
13.1.2. Signals
13.2. Information on processes: ps and pstree
13.2.1. ps
13.2.2. pstree
13.3. Sending signals to processes: kill, killall and top
13.3.1. Shortcut in X: xkill
13.3.2. kill, killall
13.3.3. top

13.1. More about processes

In Processes, we mentioned that it was possible to monitor processes; that is what we will cover next. To understand the operations we are going to perform here, it is helpful to know a bit more about them.

13.1.1. Process Tree

As with files, all processes that run on a GNU/Linux system are organized in the form of a tree, and each process has a number (its PID, Process ID), together with the number of its parent process (PPID, Parent Process ID).

This means that there is a process at the top of the tree structure, the equivalent of the root for filesystems: init (see Reference manual), which is always numbered 1. The next section will explain two commands, ps and pstree, which allow you to obtain information on a running process.

13.1.2. Signals

Every process in Unix can react to signals sent to it. There exist 31 different signals. For each of these signals, the process can define its own behavior, except for two signals: signal number 9 (KILL), and signal number 19 (STOP).

Signal 9 kills a process irrevocably, without giving it the time to terminate properly. This is the signal you send to a process which is stuck or exhibits other problems. A full list of signals is available using the command kill -l.


Tux on Star from MandrakeSoft Linux is a registered trademark of Linus Torvalds. All other trademarks and copyrights are the property of their respective owners.
Unless otherwise stated, all the content of these pages and all images are Copyright MandrakeSoft S.A. and MandrakeSoft Inc. 2000.
http://www.linux-mandrake.com/