120_进程管理
ps 查看系统中正在执行的各种进程的信息

[admin@ecs-214025 ~]$ ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.2 125388 3948 ? Ss Apr25 5:06 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root 2 0.0 0.0 0 0 ? S Apr25 0:00 [kthreadd]
root 4 0.0 0.0 0 0 ? S< Apr25 0:00 [kworker/0:0H]
root 6 0.0 0.0 0 0 ? S Apr25 0:10 [ksoftirqd/0]
root 7 0.0 0.0 0 0 ? S Apr25 0:00 [migration/0]
root 8 0.0 0.0 0 0 ? S Apr25 0:00 [rcu_bh]
root 9 0.0 0.0 0 0 ? R Apr25 7:36 [rcu_sched]
root 10 0.0 0.0 0 0 ? S< Apr25 0:00 [lru-add-drain]
[admin@ecs-214025 ~]$ ps -aux | grep tra
root 3427 0.0 18.4 2777508 346876 ? Sl May01 55:51 java -jar /opt/training/ruoyi-admin.jar
admin 18121 0.0 0.0 112812 976 pts/0 R+ 22:36 0:00 grep --color=auto tra
[admin@ecs-214025 ~]$ ps -aux | grep mysql
mysql 673 0.0 11.1 1145568 208892 ? Sl Apr25 17:33 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
admin 18255 0.0 0.0 112812 976 pts/0 R+ 22:39 0:00 grep --color=auto mysql

[admin@ecs-214025 ~]$ ps -ef | grep mysql
mysql 673 1 0 Apr25 ? 00:17:33 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
admin 19049 19015 0 22:53 pts/1 00:00:00 grep --color=auto mysql
[admin@ecs-214025 ~]$ ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.2 125388 3948 ? Ss Apr25 5:06 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root 2 0.0 0.0 0 0 ? S Apr25 0:00 [kthreadd]
[admin@ecs-214025 ~]$ ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Apr25 ? 00:05:06 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root 2 0 0 Apr25 ? 00:00:00 [kthreadd]
[admin@ecs-214025 ~]$ pstree -pu
systemd(1)─┬─NetworkManager(555)─┬─dhclient(641)
│ ├─{NetworkManager}(570)
│ └─{NetworkManager}(572)
├─agetty(1388)
├─agetty(1389)
├─atd(1383)
├─auditd(394)───{auditd}(395)
├─chronyd(534,chrony)
├─crond(1385)
├─dbus-daemon(486,dbus)
├─firewalld(1838)───{firewalld}(1926)
├─hostguard(1455)───hostguard(12259)─┬─{hostguard}(12260)
│ ├─{hostguard}(12261)
│ ├─{hostguard}(12262)
│ ├─{hostguard}(12263)
结束进程:杀掉进程
:::info
kill -9 进程ID
:::

浙公网安备 33010602011771号