What to do when Ctrl-C won't kill running job?

Occasionally, procedures overlook the SIGINT signal sent out by Ctrl - C in Bash. As an example, man and also vi. Thinking you do not intend to google or read the guidebook on just how to exit the running procedure, exists any kind of key series that will constantly function (without leaving the incurable)?

125
2019-12-03 05:52:54
Source Share
Answers: 5

Sometimes the CTRL+C is obtaining sent out to the incorrect program or input network. This is specifically usual with editors such as vi, with commands with piped result, facility bash regulates entailing loopholes, etc

A straightforward, fast remedy is to suspend the work CTRL+Z and afterwards eliminate it by work number : kill %1 or kill -9 %1, etc

10
2019-12-04 08:23:58
Source

To give up from male , usage q To leave vi make use of :q

4
2019-12-04 08:03:45
Source

You can attempt Ctrl+\

18
2019-12-04 04:19:12
Source

Try Ctrl+Alt+Backspace

If you are making use of ubuntu 10.04 you wan na enable this key to function.

To enable Control - Alt - Backspace

Goto System - - > Preferences - - > Keyboard

Select the Layouts tab and also click the Layout Options .

Select Key series to eliminate the X web server and also enable Control+Alt+Backspace .

Keep in mind :

Pressing Ctrl - Alt - Backspace will certainly reactivate your X web server.

3
2019-12-04 04:08:14
Source

Send the SIGQUIT signal with Ctrl+\.

.. $ sleep 10
^\Quit

→ This amounts kill -3 pid. Programs run in customer - room do not overlook sigquit.

There is additionally a set of Magic SysRq key-board faster ways. Among the extra intriguing ones is this : Alt+SysRq+k. It eliminates every procedure on the existing digital console. If among your ttys is entirely and also entirely damaged, this can be made use of to return . On the tty running X.org, it can be made use of to eliminate X dog-eat-dog.

The SysRq key is, on the majority of key-boards, the like the Print Key. On my note pad, it can be conjured up making use of the Fn key ; I.e. Alt → Fn → Print → k because order.

Below are several of the standard procedure monitoring shortcuts :

  • Ctrl+Z : stop a procedure (plus bg to resume behind-the-scenes, fg to raise to foreground)
  • Ctrl+C : pleasantly ask the procedure to shut down currently
  • Ctrl+\ : mercilessly eliminate the procedure that is presently in the foreground
  • Alt+SysRq+s : Write information to disk (constantly do this prior to eliminating anything vital)
  • Alt+SysRq+s, k : mercilessly eliminate all existing procedures on an offered digital console
  • Alt+SysRq+s, b : mercilessly reboot without unmounting,
  • Alt+SysRq+r, e, i, s, u, b : Safely r eboot e ven i f the s ystem is u tterly b roken,

Note : Ctrl+Z, in comparison to Ctrl+C and also Ctrl+\, additionally benefits man, vi, less, and so on.

When doubtful, the follwing procedure will certainly generally function :

~$ sleep 10
^Z
[5]+  Stopped              sleep 10
~$ ps
  PID TTY          TIME CMD
 4804 pts/0    00:00:00 bash
 6207 pts/0    00:00:00 sleep
 6208 pts/0    00:00:00 ps
~$ kill -9 6207
[5]+  Killed                  sleep 10
~$ 

^ Z certainly shows that Ctrl+Z has actually been pushed.


For an extra in - deepness consider Shells and also Terminals, additionally see my solutions on :

184
2019-12-04 04:06:44
Source