what to do when ctrl-c can't kill a process?
On my laptop I press the laptop function key + break. On my desktop, my break key (next to print screen) is like this:
If I press it (no Ctrl/Alt/etc) I get this (ignore the echo's, they're just there so I could work out what was what):
# sleep 10;echo "no ctrl/alt/shift/etc" + Stopped sleep 10
If I press it with shift, I get this:
[root@ID6052 public_html]# sleep 10;echo "shift + pause/break" + Stopped sleep 10
If I press it with Ctrl nothing happens.
If I press Pause/Break with Alt, I get this:
[root@ID6052 public_html]# sleep 10;echo "alt + pause/break" + Stopped sleep 10
How do I get it to just stop the program? If I get a list of running processes, all these "[xx]+ Stopped…" commands show up (in a stopped state). On my laptop, pressing the func+break (ie, just normal break key…the func button is also used for scroll lock, print screen etc) closes the programs down completely!
Normally a unix shell will have the following key mappings
control-C => SIGINT (interupt)
control-Z => SIGTSTP (terminal stop / suspend)
sometimes there is also
control-y => delayed stop (not sure how this is done)
Control-C will typically interrupt and terminate your program. But SIGINT can be handled and ignored or processed by the program.
Control-Z will typically suspend (stop) your program. But SIGSTSP can also be handled and ignored or processed by the program, although in practice this seems rarer than handling SIGINT.
Sending a SIGSTOP (
kill -STOPfrom another terminal) will suspend (stop) your program and cannot be handled.
It looks like your key combinations that cause your program to be 'Stopped' are probably equivalent to Control-Z.
If you get processes in the stopped state, the your shell reports the job number. Looks like you might be using bash. Anyway, most shells will let you control stopped or background jobs using their job numbers.
And so on to, kill, kill, put in background or put in foreground your (first) job respectively.
You can use the command
To list jobs currently associated with the shell you are in. Well, depending on which shell it is, which you don't specify.