This question already has an answer here:
- Terminating an infinite loop 9 answers
I run my command in a loop. I wrote the loop directly to a bash command line:
$ while true; do mycommand; done
mycommand is a command doing a lot of io and waiting for events so it does not consume much processor time.
How can I interrupt the loop? When I press
ctrl-\ then mycommand is terminated but it is started again immediately. When I log in to another terminal and kill the command then the situation is the same.
Is it possible to interrupt the loop without killing the terminal session?