What are Linux signals?

A signal is an event generated by the UNIX and Linux systems in response to some condition. Upon receipt of a signal, a process may take action.

A signal is just like an interrupt; when it is generated at the user level, a call is made to the kernel of the OS, which then acts accordingly.

There are two types of signals:

  • Maskable: signals which can be changed or ignored by the user (e.g., Ctrl+C).
  • Non-Maskable: signals which cannot be changed or ignored by the user. These typically occur when the user is signaled for non-recoverable hardware errors.

Signals List

The table below contains some common signals and their associated meanings.

Signal Description
SIGHUP Hang-up detected on controlling terminal or death of controlling process.
SIGINT Issued if the user sends an interrupt signal (Ctrl + C).
SIGQUIT Issued if the user sends a quit signal (Ctrl + D).
SIGFPE Issued if an illegal mathematical operation is attempted.
SIGKILL If a process gets this signal, it must quit immediately and will not perform any clean-up operations.
SIGTERM Software termination signal (sent kill by default).
SIGALRM Alarm clock signal (used for timers).

First install man-db package to install man pages. For this purpose use the following command:

apt-get install man-db

To get a complete table with a summary of the meaning of each signal, use the following command:

man 7 signal

To test the commands given above, use the terminal provided below:

Terminal 1
Terminal
Loading...

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved