I run my command in a loop. I wrote the loop directly to a bash command line:$ while true; do mycommand; donemycommand 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-c or 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?
kill bash loop executed from command line
bash;command line
A simple enough way to kill loops started interactively would be to stop the command (Ctrl-Z), which should print a job number, say [2]+  Stopped, which you can then kill using kill %2.