[Linux] ps查看当前进程指定程序进程

[root@localhost ~]# ps -le
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
...
4 S     0  1128  1038  2  80   0 -  3421 -      pts/1    00:05:22 python
4 S     0  1129  1041  0  80   0 -  3011 -      pts/2    00:00:00 python
0 S     0  1130  1044  2  80   0 - 31105 -      pts/3    00:05:18 python
...
[root@localhost ~]# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
...
root      1128  2.4  1.0  13684  9664 pts/1    S+   02:58   5:22 python /home/pi/wireless-receiver/receiver/main.py
root      1129  0.0  0.8  12044  7884 pts/2    S+   02:58   0:00 python /home/pi/wireless-receiver/broadcast_server/broadcast_server.py
root      1130  2.4  1.5 124420 14824 pts/3    Sl+  02:58   5:18 python /home/pi/wireless-receiver/web_server/root.py
[root@localhost /]# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 18:28 ?        00:00:00 /usr/lib/systemd/systemd --switc
root         2     0  0 18:28 ?        00:00:00 [kthreadd]
root         3     2  0 18:28 ?        00:00:00 [ksoftirqd/0]
root         4     2  0 18:28 ?        00:00:00 [kworker/0:0]
root         5     2  0 18:28 ?        00:00:00 [kworker/0:0H]
root         6     2  0 18:28 ?        00:00:00 [kworker/u2:0]
root         7     2  0 18:28 ?        00:00:00 [migration/0]
root         8     2  0 18:28 ?        00:00:00 [rcu_bh]
root         9     2  0 18:28 ?        00:00:00 [rcu_sched]
root        10     2  0 18:28 ?        00:00:00 [watchdog/0]
root        12     2  0 18:28 ?        00:00:00 [kdevtmpfs]
root        13     2  0 18:28 ?        00:00:00 [netns]
root        14     2  0 18:28 ?        00:00:00 [khungtaskd]
root        15     2  0 18:28 ?        00:00:00 [writeback]
root        16     2  0 18:28 ?        00:00:00 [kintegrityd]
root        17     2  0 18:28 ?        00:00:00 [bioset]
root        18     2  0 18:28 ?        00:00:00 [kblockd]
root        19     2  0 18:28 ?        00:00:00 [md]
root        20     2  0 18:28 ?        00:00:00 [kworker/0:1]
root        25     2  0 18:28 ?        00:00:00 [kswapd0]

[root@localhost /]# ps -ef | grep python
root       648     1  0 18:28 ?        00:00:00 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
root       974     1  0 18:28 ?        00:00:00 /usr/bin/python -Es /usr/sbin/tuned -l -P
root      1213  1197  0 18:38 pts/0    00:00:00 grep --color=auto python

原文地址:https://www.cnblogs.com/xianeri/p/13324282.html