等同于在取消程序的命令中ctrl c [英] Equivalent of ctrl c in command to cancel a program
问题描述
我在远程机器上运行一个长程序,我想停止它,但我的问题是,如果我使用kill命令,然后程序将退出而不保存结果。通常我完成程序使用ctrl c,在这种情况下程序保存结果,但现在我不在运行会话的机器,所以我不能做ctrl c。
I am running a long 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 using 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 do ctrl c.
我的问题是:在远程方式有什么办法等效于ctrl c。
My question is: is there any way to do in a remote way the equivalent of ctrl c?.
推荐答案
尝试:
kill -SIGINT processPIDHere
基本上 Ctrl C 发送 SIGINT
$ c> SIGTERM (终止)信号,除非您指定要发送的信号。
Basically Ctrl C sends the SIGINT
(interrupt) signal while kill sends the SIGTERM
(termination) signal by default unless you specify the signal to send.
这篇关于等同于在取消程序的命令中ctrl c的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!