While logged into a Bash shell on a Linux server, you start a large copy operation in the foreground:
$ cp -av /media/usb/ /srv/data/
Realizing you chose the wrong destination, you press Ctrl + c in the same terminal. The copy stops immediately and the prompt returns. According to POSIX signal behavior, which signal did the terminal send to the cp process and what is that signal's default action?
SIGTSTP (signal 20) - suspend (stop) the process
SIGQUIT (signal 3) - terminate the process and create a core dump
SIGTERM (signal 15) - request the process to terminate gracefully
Pressing Ctrl + c causes the terminal driver to deliver the SIGINT (interrupt) signal, number 2, to every process in the current foreground process group. Unless the process has installed a custom handler or masked the signal, the kernel's default disposition for SIGINT is to terminate the process. That is why the cp command aborted as soon as you pressed Ctrl + c and control returned to the shell. SIGTERM (15) is the default signal sent by the kill command, not by Ctrl + c; SIGQUIT (3) is generated by Ctrl+\ and would terminate the process while producing a core dump; SIGTSTP (20) is generated by Ctrl+z and suspends (stops) the process rather than terminating it.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is SIGINT and how is it different from SIGTERM?
Open an interactive chat with Bash
What happens if a process overrides the default SIGINT behavior?
Open an interactive chat with Bash
How does Ctrl + z differ from Ctrl + c in signaling processes?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access