Equivalent of ctrl c in command to cancel a program

前端 未结 6 2000
渐次进展
渐次进展 2020-12-24 00:29

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 resu

6条回答
  •  被撕碎了的回忆
    2020-12-24 00:47

    Here's an example for mongod

    To start the daemon from the command line:

    mongod &
    

    Then later

    kill -SIGINT `pgrep mongod`
    

提交回复
热议问题