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.

Sometimes after I accidentally typing something in the terminal, e.g. after invoking a "tee" command I am unable to quit from that program to get back to the terminal. I usually try typing :q, quit, CTRL-Break, but nothing helps. So I close the terminal and open a new instance. Is there a standard way to quit from the executing command?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You can Use Ctrl + C or can use Ctrl + Z key to terminate a running process in command line

share|improve this answer
Thank you. What is the difference b/w CTRL+C and CTRL+Z in that case? –  Mitten Aug 10 '13 at 8:41
Ctrl+C sends a signal to the the program to exit, while Ctrl+Z suspends the program. The program in question can choose what to do when receiving the signal from Ctrl+C, whereas Ctrl+Z stops it right away. You should only use Ctrl+Z when Ctrl+C doesn't work (since Ctrl+C gives the program the chance to clean up temporary files and so on). –  evilsoup Aug 10 '13 at 9:27
add comment

Your Answer


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.