Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Ok, I don't know why, but I've seen this question been asked many times, but none of the answers seem to be helpful, yet the problem is quite obvious, because I verified it on several computers. Ctrl+C does NOT kill a running program in terminal (Ubuntu v10) even though it's supposed to. I wonder if anyone can actually point a solution that actually works.

So far I've tried Ctrl+\, Ctrl+SysRq+K, and much more - nothing works!

The only thing that did work, sort of, is Ctrl+Z, but it doesn't actually kill/exit the program, but simply puts it in a background and then you still have to do kill %1 to actually kill it.

Thanks!

share|improve this question
    
I'm pretty sure it will kill most terminal programs; of course, it won't kill the ones that fork a new process, then return the prompt immediately. Some programs may catch this interrupt and handle it however they want, or even ignore it. It may depend a lot on whether the program is designed to be run in a terminal or from a GUI. –  Marty Fried Jun 14 '12 at 2:40
    
I've tried many programs and none of them quit. Can you point an example program so I can verify it again? –  techexpert Jun 14 '12 at 2:41
    
Well, the one I use a lot is ping, because by default, it runs continuously. Also, the find command, or most any other bash command. Even gedit seems to work for me. I'm using 11.10, but I don't think it has changed. Are you using 10.04? I have an old 10.04 system I can test - just did, it also acts the same. –  Marty Fried Jun 14 '12 at 2:52
    
I just tried the 'ping' and to my surprise it actually worked! I am pretty sure I've used it many times before, but I guess I am so used to 'Ctrl+Z' these days that I probably was doing just that :). It's pitty that most of the other programs I use don't obey Ctrl+C, because Ctrl+Z is begining to drive me nuts! –  techexpert Jun 14 '12 at 2:57
1  
I think it should be OK to Ctrl+C, because it's not exactly a kill or Ctrl+K (which also doesn't work in those programs, btw), so the program should still be able to clean up after itself, but most programs these days choose to ignore it for some reason and this is just plain wrong and makes the command line less usable, IMO –  techexpert Jun 14 '12 at 3:05

2 Answers 2

up vote 2 down vote accepted

Note: Answer andded after comments...

I'm pretty sure it will kill most terminal programs; of course, it won't kill the ones that fork a new process, then return the prompt immediately.

Some programs may catch this interrupt and handle it however they want, or even ignore it. It may depend a lot on whether the program is designed to be run in a terminal or from a GUI.

A few of the programs I just tried in 10.04 and 11.10 that will end are:

ping - which runs continuously by default, so this is the only way to stop it;
find - often takes a long time, so it's useful to be able to end it.
gedit
share|improve this answer
    
Sorry, I can't "vote up" just yet because my reputation is still very low, but I accepted the answer :) Thanks for your help! –  techexpert Jun 14 '12 at 3:42
    
You're welcome, and thanks for trying. You'll get there soon enough. :) –  Marty Fried Jun 14 '12 at 4:46

I have faced this problem with one of my user having 10.04. The same issue has been discussed here CTRL+C no longer works in terminal

You can however terminate command using CTRL+SHIFT+C

It seems like copy-to-clipboard and terminate commands switched their keyboard shortcuts.

share|improve this answer
    
I did read this a while ago too and I have tried to disable the keyboard shortcuts for Ctrl+SHIFT+C, but it didn't make any difference for those programs that ignore Ctrl+C –  techexpert Jun 14 '12 at 3:45
    
programs like vim does not accept CTRL+C to quit/terminate itself. –  Umair A. Shahid Jun 14 '12 at 3:51
    
Yes, I noticed, which is why I asked the question in the first place –  techexpert Jun 14 '12 at 3:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.