【问题标题】:In bash how to print all sibling processes of current process在bash中如何打印当前进程的所有兄弟进程
【发布时间】:2020-01-24 13:33:13
【问题描述】:

我知道当前进程的 pid...我正在尝试找出与当前进程的 pid 具有相同 ppid 的进程

【问题讨论】:

    标签: linux bash process pid


    【解决方案1】:

    您可以使用ps--ppid按父PID选择,使用bash内置变量PPID

    ps --ppid "$PPID"
    

    【讨论】:

    • --ppid 在哪个版本中工作? ps -o ppid $PPID 应该适用于所有版本。
    • @WilliamPursell Under Mint 19.1 (Ubuton) ps --versionreturns ps from procps-ng 3.3.12.
    猜你喜欢
    • 2015-08-21
    • 1970-01-01
    • 2022-06-28
    • 1970-01-01
    • 1970-01-01
    • 2015-10-06
    • 1970-01-01
    • 2015-02-17
    • 2020-06-15
    相关资源
    最近更新 更多