gpt4 book ai didi

linux - 通过传递 id 来杀死 linux 进程

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:43:12 24 4
gpt4 key购买 nike

我想终止一个进程并通过以下方式获取其 ID:

pgrep -f "python myscript.py"

我想打电话

kill -s SIGINT 

在上面,但我找不到任何方法。

(命令需要在一行内)

最佳答案

尝试使用反引号运算符来评估子命令

kill -s SIGINT `pgrep -f "python myscript.py"`

(未经测试)

关于linux - 通过传递 id 来杀死 linux 进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20570999/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com