I am running a long linux program in a remote machine, and I want to stop it, but my problem is that if I use the kill command then the program will exit without saving results. Normally what I do to finish the program is use Ctrl+C and in that case the program saves the results, but right now I am not in the machine that is running the session so I cannot press Ctrl+C.
My question is: is there any way to do in a remote way the equivalent of Ctrl+C?
Ctrl + C should stop a program running from the command prompt, similar to linux.
Ctrl-b + :kill-session kills the current session.
How to Stop a C program in Terminal when running? If you run your C or C++ app in Command Prompt, and it is in loop or you want to end this running program, just press Ctrl+C to end the app.
Try:
kill -SIGINT processPIDHere
Basically Ctrl C sends the SIGINT
(interrupt) signal while kill sends the SIGTERM
(termination) signal by default unless you specify the signal to send.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With