gpt4 book ai didi

linux - 使用 top/ps 识别 perf 的 PID

转载 作者:太空宇宙 更新时间:2023-11-04 04:33:13 24 4
gpt4 key购买 nike

我需要使用 PID 杀死 bash 脚本中的 perf。但是,无法识别perf的PID(使用top)。任何指示表示赞赏。 Ubuntu XX 16.04.2。谢谢。

最佳答案

您可以 grep ps 查找该进程并从那里获取其 id。然后将其输出与您的kill命令一起使用。

kill $(ps aux | awk '/perf/{print $2}')

关于linux - 使用 top/ps 识别 perf 的 PID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44050040/

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