← Back to list

Ctrl+c,Ctrl + z signals

In Unix-like operating systems, including Linux, the Ctrl+C and Ctrl+Z key combinations are used to send interrupt signals to the…

Kumar Raghav Sharma · 2024-01-01 17:31 · 0 claps · 1.0 min read
#ctrl-c #ctrlz
Open on Medium ↗
Wiki topics: ML · Machine Learning 🔓 · Open Source

Ctrl+c,Ctrl + z signals

In Unix-like operating systems, including Linux, the Ctrl+C and Ctrl+Z key combinations are used to send interrupt signals to the foreground process running in a terminal. These signals are handled by the terminal and result in different actions for the running process.

Ctrl+C (SIGINT):

  • When you press Ctrl+C, it sends the SIGINT (Signal Interrupt) signal to the foreground process.
  • By default, this signal is used to interrupt and terminate the currently running process in the terminal.
  • The process receives this signal, and its default behavior is to terminate. However, processes can override this default behavior and handle the signal in their own way.

Ctrl+Z (SIGTSTP):

  • When you press Ctrl+Z, it sends the SIGTSTP (Signal Stop) signal to the foreground process.
  • This signal is used to suspend (pause) the process.
  • The process receives this signal, and its default behavior is to stop execution. The process is then moved to the background, and you get control back in the terminal.

To view the actual commands that are run when you press Ctrl+C or Ctrl+Z, you can use the stty command to display the terminal settings. The stty -a command will show you the current settings, including the characters associated with these signals.

stty -a

Look for lines that resemble the following:

intr = ^C
susp = ^Z

Here, intr indicates the interrupt character (Ctrl+C), and susp indicates the suspend character (Ctrl+Z). The actual actions taken when these characters are pressed depend on the terminal settings and the behavior of the running process.


메타데이터
post_id
00d29050a88a
slug
ctrl-c-ctrl-z-signals-00d29050a88a
url
https://medium.com/@raghavshrm987/ctrl-c-ctrl-z-signals-00d29050a88a
canonical_url
https://medium.com/@raghavshrm987/ctrl-c-ctrl-z-signals-00d29050a88a
author_url
https://medium.com/@raghavshrm987
status
ok
fetched_at
2026-06-28 10:39:35