In case a program cannot be terminated in the normal way, use the kill command
to stop the process (or processes) belonging to that program. To do so, specify the
process ID (PID) shown by the output of ps. For example, to shut down the KWrite
editor in the example above, enter
kill 30187
This sends a TERM signal that instructs the program to shut itself down.
Alternatively, if the program or process you want to terminate is a background job
and is shown by the jobs command, you can also use the kill command in combi-
nation with the job number to terminate this process. When identifying the job with
the job number, you must prex the number with a percent character (%):
kill %
job_number
If kill does not help—as is sometimes the case for “runaway” programs—try
kill -9
PID
This sends a KILL signal instead of a TERM signal, bringing the specied process to
an end in most cases.
This section is intended to introduce the most basic set of commands for handling
jobs and processes. Find an overview for system administrators in Section “Processes”
(Chapter 2, System Monitoring Utilities, ↑System Analysis and Tuning Guide).
17.12 Important Linux Commands
This section gives insight into the most important commands. There are many more
commands than listed in this chapter. Along with the individual commands, parame-
ters are listed and, where appropriate, a typical sample application is introduced. To
learn more about the various commands, use the manual pages, accessed with man
followed by the name of the command, for example, man ls.
Man pages are displayed directly in the shell. To navigate them, move up and down
with [Page ↑] and [Page ↓]. Move between the beginning and the end of a document
with [Home] and [End]. End this viewing mode by pressing [Q]. Learn more about
the man command itself with man man.
In the following overview, the individual command elements are written in dierent
typefaces. The actual command and its mandatory options are always printed as
command option. Specications or parameters that are not required are placed in
[square brackets].
Adjust the settings to your needs. It makes no sense to write ls file if no le named
file actually exists. You can usually combine several parameters, for example, by
writing ls -la instead of ls -l -a.
214 Start-Up