I would like to be able to send the SIGTERM signal with a command line shortcut, like I can send SIGINT with Ctrl+C.
I ve read before about ctrl+d, but that does not work here, nothing happen.
I also read this SO SIGTERM with a keyboard shortcut.
$ stty -a speed 38400 baud; rows 43; columns 123; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0; -parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -extproc Is quit the signal i want to trigger? Is kill the signal i want to trigger?
And very stupidly... How to input that '^\' or '^U' in my keyboard? I shall just type it then press enter?
32 Answers
No, SIGTERM cannot be sent from the command line, as noted at: .
It's not entirely true that you can't send SIGTERM from the command line. You can't send it from a keyboard shortcut, but you can send it from the command line.
Based on the man-page for kill, you are able to send a SIGTERM to any process. You would accomplish this by finding your process in the process table (type ps) and then typing kill -15 [pid].
Here is a list of the keyboard shortcuts that you can use in a terminal to handle processes:
- Ctrl+C sends
SIGINTwhich asks to interrupt a program but can be caught or ignored. - Ctrl+Z sends
SIGTSTPwhich asks to pause a program but can be caught or ignored. This process can be resumed later. - Ctrl+\ sends
SIGQUITwhich is the same asSIGINTexcept it also produces a core dump.