gpt4 book ai didi

linux - Pidof 找不到进程

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:19:59 26 4
gpt4 key购买 nike

我想使用 pidof 或 ps 命令或任何命令找出 shell 脚本进程 ID。

我想要的只是它的进程ID。我使用过“pidof -x test.sh”。这是行不通的。注意:我不想调用/bin/sh 或/bin/bash - 因为脚本将不起作用。如果我在脚本中调用/bin/sh,pidof 正在运行。

请帮忙

最佳答案

pgrep -f 脚本给出了预期的结果。谢谢

关于linux - Pidof 找不到进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28107410/

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