What is Signal (Unix)?

On Linux and similar systems, a short notification by which the OS or another process tells a process about an event. Each has a fixed number and name: SIGTERM (15), the default of kill, requests termination, SIGKILL (9) forces it, SIGINT (2) comes from Ctrl+C, SIGTSTP suspends a job on Ctrl+Z, and SIGHUP (1) reports that the terminal was disconnected. For many signals a process can provide a routine (handler) to run on receipt or ignore them, but SIGKILL and SIGSTOP can be neither received nor ignored. Shell scripts set handlers with trap.

Japanese name: シグナル(Unix)

Signal (Unix) appears in 1 practice question across 1 topic, including Linux and Command-Line Basics.

Field: Linux and Command-Line Basics

Try it: questions about Signal (Unix)

When stopping a process that has stopped responding, it is recommended to first use "kill <process ID>" and to use "kill -9 <process ID>" only if that does not end it. Which of the following is the reason?

  1. AThe default SIGTERM (number 15) can be received by the process so that it can clean up before exiting, whereas SIGKILL (number 9) cannot be received and ends it forcibly without cleanup
  2. BSIGTERM (number 15), which kill sends by default, ends everything including child processes, whereas SIGKILL (number 9) ends only the specified process and so has less impact
  3. CSIGKILL (number 9) can be received by the process so that it can clean up before exiting, whereas SIGTERM (number 15), which kill sends by default, cannot be ignored and ends it at once
Show answer and explanation

Answer: A. The default SIGTERM (number 15) can be received by the process so that it can clean up before exiting, whereas SIGKILL (number 9) cannot be received and ends it forcibly without cleanup

A signal is a short notification by which the OS tells a process about an event, and each has a fixed number and name. Without options, kill sends SIGTERM (number 15); a program can provide a routine (handler) that receives it, saving files in progress or deleting temporary files before exiting. SIGKILL (number 9) can be neither received nor ignored by the process, and the kernel ends it forcibly, so half-written files may be left corrupted. The ID of the process to stop is found with ps or top.

Signal (Unix) in the explanations

Questions that mention Signal (Unix) (1)

  1. When stopping a process that has stopped responding, it is recommended to first use "kill <process ID>" and to use "kill -9 <process ID>" only if that does not end it. Which of the following is the reason?

Books on Linux and Command-Line Basics Ad

As an Amazon Associate I earn from qualifying purchases.

Related terms

cron Environment variable File permissions Git grep Hard link I/O redirection inode Pipe (|) Regular expression

Back to the glossary