The Computer Oracle

send SIGTERM with command line shortcut

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Mysterious Puzzle

--

Chapters
00:00 Send Sigterm With Command Line Shortcut
00:53 Accepted Answer Score 8
01:07 Answer 2 Score 34
01:53 Thank you

--

Full question
https://superuser.com/questions/1075379/...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#commandline #keyboardshortcuts

#avk47



ANSWER 1

Score 34


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 SIGINT which asks to interrupt a program but can be caught or ignored.
  • Ctrl+Z sends SIGTSTP which asks to pause a program but can be caught or ignored. This process can be resumed later.
  • Ctrl+\ sends SIGQUIT which is the same as SIGINT except it also produces a core dump.

Source 1 and Source 2




ACCEPTED ANSWER

Score 8


No, SIGTERM cannot be sent from the command line, as noted at: https://superuser.com/a/343611/199930.

See also: https://unix.stackexchange.com/q/362559/43390