当前位置:首页 > 全部文章 > 正文

终端,进程的关系,详细介绍,学习经验

ps -eo pid,ppid,sid,tty,pgrp,comm | grep -E 'bash|PID|nginx'

image.png

wan@ubuntu:~$ kill 1777
wan@ubuntu:~$ ps -eo pid,ppid,sid,tty,pgrp,comm | grep -E 'bash|PID|nginx'
    PID    PPID     SID TT          PGRP COMMAND
   1861       1    1657 ?           1861 nginx
   2606    2605    2606 pts/2       2606 bash
   2666    2606    2606 pts/2       2666 nginx
   2723    2722    2723 pts/3       2723 bash
wan@ubuntu:~$ kill 1861
wan@ubuntu:~$ ps -eo pid,ppid,sid,tty,pgrp,comm | grep -E 'bash|PID|nginx'
    PID    PPID     SID TT          PGRP COMMAND
   2606    2605    2606 pts/2       2606 bash
   2666    2606    2606 pts/2       2666 nginx
   2723    2722    2723 pts/3       2723 bash

现在我们关闭2606pid的bash后

image.png

image.png

更新时间 2025-09-15