Linux Administration
medium

Pregunta de Linux Administration #019e3987

Enunciado de la Pregunta
Linux Administration
#sigint
#ctrl+c
#signal-handling
#terminal-interrupt
#posix-signals
Medio

Which of the following signals is sent to a process when the key combination CTRL+C is pressed on the keyboard?

A

SIGTERM

B

SIGINT

Correcto
C

SIGSTOP

D

SIGKILL

Explicación Oficial / Explicaciones de la Comunidad

The signal sent when CTRL+C is pressed is SIGINT (Signal Interrupt). This signal is defined by POSIX and is used to interrupt a running process from the terminal.

How it Works

When you press CTRL+C, the terminal driver sends the SIGINT signal to the foreground process group. The default action for SIGINT is to terminate the process. Processes can catch or ignore SIGINT, but most programs handle it by terminating gracefully.

Why SIGINT is Correct

SIGINT is specifically designed for this purpose. It is generated by the terminal in response to the interrupt character (typically CTRL+C). The signal number is 2 on most Unix-like systems.

Why Other Options are Incorrect

  • SIGTERM (Signal Terminate) is sent by the kill command by default to request termination. It is not generated by keyboard shortcuts.
  • SIGSTOP (Signal Stop) suspends a process. It cannot be caught or ignored, but it is not sent by CTRL+C; CTRL+Z sends SIGTSTP instead.
  • SIGKILL (Signal Kill) forcefully terminates a process and cannot be caught. It is not sent by any keyboard shortcut; it is sent using kill -9.