查看进程Ps aux
ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.6 168500 12372 ? Ss 2022 9:51 /sbin/init
root 2 0.0 0.0 0 0 ? S 2022 0:02 [kthreadd]
root 3 0.0 0.0 0 0 ? I< 2022 0:00 [rcu_gp]
root 4 0.0 0.0 0 0 ? I< 2022 0:00 [rcu_par_gp]
root 6 0.0 0.0 0 0 ? I< 2022 0:00 [kworker/0:0H-events_highpri]
root 8 0.0 0.0 0 0 ? I< 2022 0:00 [mm_percpu_wq]
root 9 0.0 0.0 0 0 ? S 2022 0:50 [ksoftirqd/0]
root 10 0.0 0.0 0 0 ? I 2022 137:11 [rcu_sched]
root 11 0.0 0.0 0 0 ? S 2022 1:02 [migration/0]
root 12 0.0 0.0 0 0 ? S 2022 0:00 [idle_inject/0]
root 14 0.0 0.0 0 0 ? S 2022 0:00 [cpuhp/0]
root 15 0.0 0.0 0 0 ? S 2022 0:00 [cpuhp/1]
root 16 0.0 0.0 0 0 ? S 2022 0:00 [idle_inject/1]
root 17 0.0 0.0 0 0 ? S 2022 0:55 [migration/1]
root 18 0.0 0.0 0 0 ? S 2022 0:38 [ksoftirqd/1]
root 20 0.0 0.0 0 0 ? I< 2022 0:00 [kworker/1:0H-events_highpri]
root 21 0.0 0.0 0 0 ? S 2022 0:00 [kdevtmpfs]
root 22 0.0 0.0 0 0 ? I< 2022 0:00 [netns]
root 23 0.0 0.0 0 0 ? S 2022 0:00 [rcu_tasks_kthre]
root 24 0.0 0.0 0 0 ? S 2022 0:00 [kauditd]
root 25 0.0 0.0 0 0 ? S 2022 0:04 [khungtaskd]
root 26 0.0 0.0 0 0 ? S 2022 0:00 [oom_reaper]
root 27 0.0 0.0 0 0 ? I< 2022 0:00 [writeback]
root 28 0.0 0.0 0 0 ? S 2022 0:00 [kcompactd0]
root 29 0.0 0.0 0 0 ? SN 2022 0:00 [ksmd]
root 30 0.0 0.0 0 0 ? SN 2022 0:00 [khugepaged]
root 76 0.0 0.0 0 0 ? I< 2022 0:00 [kintegrityd]
root 77 0.0 0.0 0 0 ? I< 2022 0:00 [kblockd]
root 78 0.0 0.0 0 0 ? I< 2022 0:00 [blkcg_punt_bio]
root 80 0.0 0.0 0 0 ? I< 2022 0:00 [tpm_dev_wq]
root 81 0.0 0.0 0 0 ? I< 2022 0:00 [ata_sff]
root 82 0.0 0.0 0 0 ? I< 2022 0:00 [md]
root 83 0.0 0.0 0 0 ? I< 2022 0:00 [edac-poller]
root 84 0.0 0.0 0 0 ? I< 2022 0:00 [devfreq_wq]
root 85 0.0 0.0 0 0 ? S 2022 0:00 [watchdogd]
root 88 0.0 0.0 0 0 ? S 2022 0:06 [kswapd0]
root 89 0.0 0.0 0 0 ? S 2022 0:00 [ecryptfs-kthrea]
root 91 0.0 0.0 0 0 ? I< 2022 0:00 [kthrotld]
root 92 0.0 0.0 0 0 ? I< 2022 0:00 [acpi_thermal_pm]
root 93 0.0 0.0 0 0 ? S 2022 0:00 [scsi_eh_0]
root 94 0.0 0.0 0 0 ? I< 2022 0:00 [scsi_tmf_0]
root 95 0.0 0.0 0 0 ? S 2022 0:00 [scsi_eh_1]
root 96 0.0 0.0 0 0 ? I< 2022 0:00 [scsi_tmf_1]
root 98 0.0 0.0 0 0 ? I< 2022 0:00 [vfio-irqfd-clea]
root 99 0.0 0.0 0 0 ? I< 2022 9:05 [kworker/0:1H-events_highpri]
root 101 0.0 0.0 0 0 ? I< 2022 9:02 [kworker/1:1H-events_highpri]
root 102 0.0 0.0 0 0 ? I< 2022 0:00 [ipv6_addrconf]
root 111 0.0 0.0 0 0 ? I< 2022 0:00 [kstrp]
root 114 0.0 0.0 0 0 ? I< 2022 0:00 [kworker/u5:0]
root 127 0.0 0.0 0 0 ? I< 2022 0:00 [charger_manager]
root 167 0.0 0.0 0 0 ? I< 2022 0:00 [cryptd]
root 234 0.0 0.0 0 0 ? I< 2022 0:00 [raid5wq]
root 282 0.0 0.0 0 0 ? S 2022 3:37 [jbd2/vda2-8]
root 283 0.0 0.0 0 0 ? I< 2022 0:00 [ext4-rsv-conver]
root 357 0.0 4.5 150028 92768 ? S<s 2022 44:48 /lib/systemd/systemd-journald
root 376 0.0 0.0 0 0 ? I< 2022 0:00 [rpciod]
root 377 0.0 0.0 0 0 ? I< 2022 0:00 [xprtiod]
root 390 0.0 0.2 21776 5760 ? Ss 2022 0:55 /lib/systemd/systemd-udevd
root 627 0.0 0.0 0 0 ? I< 2022 0:00 [kaluad]
root 628 0.0 0.0 0 0 ? I< 2022 0:00 [kmpath_rdacd]
root 629 0.0 0.0 0 0 ? I< 2022 0:00 [kmpathd]
root 630 0.0 0.0 0 0 ? I< 2022 0:00 [kmpath_handlerd]
root 631 0.0 0.8 214596 17944 ? SLsl 2022 28:56 /sbin/multipathd -d -s
_rpc 648 0.0 0.2 8080 4732 ? Ss 2022 0:39 /sbin/rpcbind -f -w
systemd+ 715 0.0 0.3 26572 6420 ? Ss 2022 1:10 /lib/systemd/systemd-networkd
systemd+ 717 0.0 0.6 23856 12796 ? Ss 2022 0:39 /lib/systemd/systemd-resolved
root 730 0.0 0.3 235588 7064 ? Ssl 2022 13:27 /usr/lib/accountsservice/accounts-daemon
root 731 0.0 0.0 2540 780 ? Ss 2022 0:00 /usr/sbin/acpid
message+ 733 0.0 0.2 7628 4552 ? Ss 2022 0:10 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
bind 746 0.0 1.4 378516 29640 ? Ssl 2022 22:59 /usr/sbin/named -f -u bind
root 749 0.0 0.8 29708 17952 ? Ss 2022 0:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
root 770 0.0 0.3 16804 7524 ? Ss 2022 0:24 /lib/systemd/systemd-logind
ntp 796 0.0 0.1 74632 3244 ? Ssl 2022 15:16 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 112:117
root 799 0.0 0.0 5108 220 ? Ss 2022 7:43 /sbin/iscsid
root 800 0.0 0.2 5612 5428 ? S<Ls 2022 0:00 /sbin/iscsid
root 816 0.0 0.0 0 0 ? I< 2022 0:00 [iscsi_eh]
root 847 0.0 0.3 12172 6760 ? Ss 2022 14:04 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
root 897 0.0 0.9 107920 19728 ? Ssl 2022 0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
redis 905 0.1 0.1 50188 3364 ? Ssl 2022 466:22 /usr/bin/redis-server 127.0.0.1:6379
root 1068 0.0 0.3 232712 6748 ? Ssl 2022 0:01 /usr/lib/policykit-1/polkitd --no-debug
root 1072 0.0 0.1 5600 2076 ttyS0 Ss+ 2022 0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS0 vt220
root 1076 0.0 0.0 5828 1776 tty1 Ss+ 2022 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
root 3298039 0.0 0.2 38068 4572 ? Ss Jul31 0:06 /usr/lib/postfix/sbin/master -w
postfix 3298041 0.0 0.2 38388 6076 ? S Jul31 0:00 qmgr -l -t unix -u
syslog 3298157 0.0 0.2 224344 4396 ? Ssl Jul31 0:15 /usr/sbin/rsyslogd -n -iNONE
postfix 3298990 0.0 0.4 42136 8992 ? S Jul31 0:00 tlsmgr -l -t unix -u -c
root 3308923 0.0 0.4 29364 8136 ? Sl Aug02 1:24 /usr/local/qcloud/tat_agent/tat_agent
root 3347759 0.0 0.0 0 0 ? I 03:10 0:14 [kworker/1:0-events]
root 3352905 0.0 0.0 0 0 ? I 13:05 0:00 [kworker/0:1-events]
root 3352907 0.0 0.0 0 0 ? I 13:05 0:00 [kworker/1:1]
postfix 3352924 0.0 0.3 38336 6132 ? S 13:08 0:00 pickup -l -t unix -u -c
root 3353222 0.0 0.0 0 0 ? I 14:00 0:00 [kworker/u4:0-events_unbound]
root 3353282 0.0 0.4 13892 8932 ? Ss 14:25 0:00 sshd: root@pts/0
root 3353297 0.0 0.4 18332 9368 ? Ss 14:25 0:00 /lib/systemd/systemd --user
root 3353299 0.0 0.2 169716 4436 ? S 14:25 0:00 (sd-pam)
root 3353304 0.0 0.0 0 0 ? I 14:25 0:00 [kworker/0:2-events]
root 3353400 0.0 0.2 8292 5084 pts/0 Ss 14:25 0:00 -bash
root 3353416 0.0 0.0 0 0 ? I 14:25 0:00 [kworker/u4:2-events_power_efficient]
root 3353427 0.0 0.1 6892 3160 pts/0 S+ 14:30 0:00 /bin/bash /usr/bin/ps aux
root 3353428 0.0 0.1 8888 3332 pts/0 R+ 14:30 0:00 ps.original aux
USER
表示该进程是以哪个用户来运行
PID
进程的ID号
%CPU
占CPU的百分比
%MEM
占内存的百分比
VSZ
占用虚拟内存的大小
RSS TTY
占物理内存的大小
STAT
当前状态
START
启动时间
TIME
占CPU运行时间
COMMAND
产生进程的命令名
或者ps -le
ps -le
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
4 S 0 1 0 0 80 0 - 42125 ep_pol ? 00:09:51 systemd
1 S 0 2 0 0 80 0 - 0 kthrea ? 00:00:02 kthreadd
1 I 0 3 2 0 60 -20 - 0 rescue ? 00:00:00 rcu_gp
1 I 0 4 2 0 60 -20 - 0 rescue ? 00:00:00 rcu_par_gp
1 I 0 6 2 0 60 -20 - 0 worker ? 00:00:00 kworker/0:0H-events_highpri
1 I 0 8 2 0 60 -20 - 0 rescue ? 00:00:00 mm_percpu_wq
1 S 0 9 2 0 80 0 - 0 smpboo ? 00:00:50 ksoftirqd/0
1 I 0 10 2 0 80 0 - 0 rcu_gp ? 02:17:11 rcu_sched
1 S 0 11 2 0 -40 - - 0 smpboo ? 00:01:02 migration/0
5 S 0 12 2 0 9 - - 0 smpboo ? 00:00:00 idle_inject/0
1 S 0 14 2 0 80 0 - 0 smpboo ? 00:00:00 cpuhp/0
1 S 0 15 2 0 80 0 - 0 smpboo ? 00:00:00 cpuhp/1
5 S 0 16 2 0 9 - - 0 smpboo ? 00:00:00 idle_inject/1
1 S 0 17 2 0 -40 - - 0 smpboo ? 00:00:55 migration/1
1 S 0 18 2 0 80 0 - 0 smpboo ? 00:00:38 ksoftirqd/1
1 I 0 20 2 0 60 -20 - 0 worker ? 00:00:00 kworker/1:0H-events_highpri
5 S 0 21 2 0 80 0 - 0 devtmp ? 00:00:00 kdevtmpfs
1 I 0 22 2 0 60 -20 - 0 rescue ? 00:00:00 netns
1 S 0 23 2 0 80 0 - 0 rcu_ta ? 00:00:00 rcu_tasks_kthre
1 S 0 24 2 0 80 0 - 0 kaudit ? 00:00:00 kauditd
1 S 0 25 2 0 80 0 - 0 watchd ? 00:00:04 khungtaskd
1 S 0 26 2 0 80 0 - 0 oom_re ? 00:00:00 oom_reaper
1 I 0 27 2 0 60 -20 - 0 rescue ? 00:00:00 writeback
1 S 0 28 2 0 80 0 - 0 kcompa ? 00:00:00 kcompactd0
1 S 0 29 2 0 85 5 - 0 ksm_sc ? 00:00:00 ksmd
1 S 0 30 2 0 99 19 - 0 khugep ? 00:00:00 khugepaged
1 I 0 76 2 0 60 -20 - 0 rescue ? 00:00:00 kintegrityd
1 I 0 77 2 0 60 -20 - 0 rescue ? 00:00:00 kblockd
1 I 0 78 2 0 60 -20 - 0 rescue ? 00:00:00 blkcg_punt_bio
1 I 0 80 2 0 60 -20 - 0 rescue ? 00:00:00 tpm_dev_wq
1 I 0 81 2 0 60 -20 - 0 rescue ? 00:00:00 ata_sff
1 I 0 82 2 0 60 -20 - 0 rescue ? 00:00:00 md
1 I 0 83 2 0 60 -20 - 0 rescue ? 00:00:00 edac-poller
1 I 0 84 2 0 60 -20 - 0 rescue ? 00:00:00 devfreq_wq
1 S 0 85 2 0 -40 - - 0 kthrea ? 00:00:00 watchdogd
1 S 0 88 2 0 80 0 - 0 kswapd ? 00:00:06 kswapd0
1 S 0 89 2 0 80 0 - 0 ecrypt ? 00:00:00 ecryptfs-kthrea
1 I 0 91 2 0 60 -20 - 0 rescue ? 00:00:00 kthrotld
1 I 0 92 2 0 60 -20 - 0 rescue ? 00:00:00 acpi_thermal_pm
1 S 0 93 2 0 80 0 - 0 scsi_e ? 00:00:00 scsi_eh_0
1 I 0 94 2 0 60 -20 - 0 rescue ? 00:00:00 scsi_tmf_0
1 S 0 95 2 0 80 0 - 0 scsi_e ? 00:00:00 scsi_eh_1
1 I 0 96 2 0 60 -20 - 0 rescue ? 00:00:00 scsi_tmf_1
1 I 0 98 2 0 60 -20 - 0 rescue ? 00:00:00 vfio-irqfd-clea
1 I 0 99 2 0 60 -20 - 0 worker ? 00:09:05 kworker/0:1H-events_highpri
1 I 0 101 2 0 60 -20 - 0 worker ? 00:09:02 kworker/1:1H-events_highpri
1 I 0 102 2 0 60 -20 - 0 rescue ? 00:00:00 ipv6_addrconf
1 I 0 111 2 0 60 -20 - 0 rescue ? 00:00:00 kstrp
1 I 0 114 2 0 60 -20 - 0 worker ? 00:00:00 kworker/u5:0
1 I 0 127 2 0 60 -20 - 0 rescue ? 00:00:00 charger_manager
1 I 0 167 2 0 60 -20 - 0 rescue ? 00:00:00 cryptd
1 I 0 234 2 0 60 -20 - 0 rescue ? 00:00:00 raid5wq
1 S 0 282 2 0 80 0 - 0 kjourn ? 00:03:37 jbd2/vda2-8
1 I 0 283 2 0 60 -20 - 0 rescue ? 00:00:00 ext4-rsv-conver
4 S 0 357 1 0 79 -1 - 37507 ep_pol ? 00:44:48 systemd-journal
1 I 0 376 2 0 60 -20 - 0 rescue ? 00:00:00 rpciod
1 I 0 377 2 0 60 -20 - 0 rescue ? 00:00:00 xprtiod
4 S 0 390 1 0 80 0 - 5444 ep_pol ? 00:00:55 systemd-udevd
1 I 0 627 2 0 60 -20 - 0 rescue ? 00:00:00 kaluad
1 I 0 628 2 0 60 -20 - 0 rescue ? 00:00:00 kmpath_rdacd
1 I 0 629 2 0 60 -20 - 0 rescue ? 00:00:00 kmpathd
1 I 0 630 2 0 60 -20 - 0 rescue ? 00:00:00 kmpath_handlerd
4 S 0 631 1 0 -40 - - 53649 futex_ ? 00:28:56 multipathd
4 S 113 648 1 0 80 0 - 2020 poll_s ? 00:00:39 rpcbind
4 S 100 715 1 0 80 0 - 6643 ep_pol ? 00:01:10 systemd-network
4 S 101 717 1 0 80 0 - 5964 ep_pol ? 00:00:39 systemd-resolve
4 S 0 730 1 0 80 0 - 58897 poll_s ? 00:13:27 accounts-daemon
4 S 0 731 1 0 80 0 - 635 poll_s ? 00:00:00 acpid
4 S 103 733 1 0 80 0 - 1907 ep_pol ? 00:00:10 dbus-daemon
4 S 115 746 1 0 80 0 - 94629 do_sig ? 00:22:59 named
4 S 0 749 1 0 80 0 - 7427 poll_s ? 00:00:00 networkd-dispat
4 S 0 770 1 0 80 0 - 4201 ep_pol ? 00:00:24 systemd-logind
5 S 112 796 1 0 80 0 - 18658 poll_s ? 00:15:16 ntpd
1 S 0 799 1 0 80 0 - 1277 hrtime ? 00:07:43 iscsid
5 S 0 800 1 0 70 -10 - 1403 poll_s ? 00:00:00 iscsid
1 I 0 816 2 0 60 -20 - 0 rescue ? 00:00:00 iscsi_eh
4 S 0 847 1 0 80 0 - 3043 poll_s ? 00:14:04 sshd
4 S 0 897 1 0 80 0 - 26980 poll_s ? 00:00:00 unattended-upgr
1 S 116 905 1 0 80 0 - 12547 ep_pol ? 07:46:22 redis-server
4 S 0 1068 1 0 80 0 - 58178 poll_s ? 00:00:01 polkitd
4 S 0 1072 1 0 80 0 - 1400 poll_s ttyS0 00:00:00 agetty
4 S 0 1076 1 0 80 0 - 1457 poll_s tty1 00:00:00 agetty
5 S 0 3298039 1 0 80 0 - 9517 ep_pol ? 00:00:06 master
4 S 117 3298041 3298039 0 80 0 - 9597 ep_pol ? 00:00:00 qmgr
4 S 104 3298157 1 0 80 0 - 56086 poll_s ? 00:00:15 rsyslogd
4 S 117 3298990 3298039 0 80 0 - 10534 ep_pol ? 00:00:00 tlsmgr
1 S 0 3308923 1 0 80 0 - 7341 ep_pol ? 00:01:24 tat_agent
1 I 0 3347759 2 0 80 0 - 0 worker ? 00:00:14 kworker/1:0-mm_percpu_wq
1 I 0 3352905 2 0 80 0 - 0 worker ? 00:00:00 kworker/0:1-mm_percpu_wq
1 I 0 3352907 2 0 80 0 - 0 worker ? 00:00:00 kworker/1:1
4 S 117 3352924 3298039 0 80 0 - 9584 ep_pol ? 00:00:00 pickup
1 I 0 3353222 2 0 80 0 - 0 worker ? 00:00:00 kworker/u4:0-events_unbound
4 R 0 3353282 847 0 80 0 - 3473 - ? 00:00:00 sshd
4 S 0 3353297 1 0 80 0 - 4583 ep_pol ? 00:00:00 systemd
5 S 0 3353299 3353297 0 80 0 - 42429 do_sig ? 00:00:00 (sd-pam)
1 I 0 3353304 2 0 80 0 - 0 worker ? 00:00:00 kworker/0:2-events
4 S 0 3353400 3353282 0 80 0 - 2073 do_wai pts/0 00:00:00 bash
1 I 0 3353416 2 0 80 0 - 0 worker ? 00:00:00 kworker/u4:2-events_unbound
1 I 0 3353430 2 0 80 0 - 0 worker ? 00:00:00 kworker/u4:1-events_power_efficient
4 S 117 3353431 3298039 0 80 0 - 10699 ep_pol ? 00:00:00 smtpd
4 S 117 3353432 3298039 0 80 0 - 9584 ep_pol ? 00:00:00 proxymap
4 S 117 3353433 3298039 0 80 0 - 9583 ep_pol ? 00:00:00 anvil
0 S 0 3353434 3353400 0 80 0 - 1723 do_wai pts/0 00:00:00 ps
4 R 0 3353435 3353434 0 80 0 - 2202 - pts/0 00:00:00 ps.original
0 R 0 3353436 3353434 0 80 0 - 1575 - pts/0 00:00:00 grep
F
标志位
S
进程状态
UID
调用进程的用户ID号
PID
进程号
PPID
父进程的ID号
C
CPU的使用率
PRI
进程优先级
NI
进程的优先级
ADDR
在内存的哪个位置
SZ
占多大内存
WCHAN
是否在运行
TTY
是哪个终端产生
TIME
占用CPU的时间
CMD
产生此进程的命令
Top能实时看到各种状态
也可以选个单个进程进行观察
Top -p 进程号
Top -b -n 1 > /root/top.log 这样才能观看完整
Pstree -pu
显示进程的用户和进程号
pstree -pu
systemd(1)-+-accounts-daemon(730)-+-{accounts-daemon}(754)
| `-{accounts-daemon}(886)
|-acpid(731)
|-agetty(1072)
|-agetty(1076)
|-dbus-daemon(733,messagebus)
|-iscsid(799)
|-iscsid(800)
|-master(3298039)-+-anvil(3353541,postfix)
| |-pickup(3353467,postfix)
| |-proxymap(3353540,postfix)
| |-qmgr(3298041,postfix)
| |-smtpd(3353539,postfix)
| `-tlsmgr(3298990,postfix)
|-multipathd(631)-+-{multipathd}(632)
| |-{multipathd}(633)
| |-{multipathd}(634)
| |-{multipathd}(635)
| |-{multipathd}(636)
| `-{multipathd}(637)
|-named(746,bind)-+-{named}(888)
| |-{named}(889)
| |-{named}(890)
| |-{named}(891)
| |-{named}(892)
| |-{named}(893)
| `-{named}(894)
|-networkd-dispat(749)
|-ntpd(796,ntp)---{ntpd}(812)
|-polkitd(1068)-+-{polkitd}(1069)
| `-{polkitd}(1071)
|-redis-server(905,redis)-+-{redis-server}(924)
| |-{redis-server}(925)
| `-{redis-server}(926)
|-rpcbind(648,_rpc)
|-rsyslogd(3298157,syslog)-+-{rsyslogd}(3298169)
| |-{rsyslogd}(3298170)
| `-{rsyslogd}(3298171)
|-sshd(847)---sshd(3353282)---bash(3353400)---pstree(3353542)-+-grep(3353544)
| `-pstree.original(3353543)
|-systemd(3353297)---(sd-pam)(3353299)
|-systemd-journal(357)
|-systemd-logind(770)
|-systemd-network(715,systemd-network)
|-systemd-resolve(717,systemd-resolve)
|-systemd-udevd(390)
|-tat_agent(3308923)-+-{tat_agent}(3308924)
| |-{tat_agent}(3308925)
| |-{tat_agent}(3308926)
| |-{tat_agent}(3308927)
| |-{tat_agent}(3308928)
| |-{tat_agent}(3308929)
| |-{tat_agent}(3308930)
| `-{tat_agent}(3308931)
`-unattended-upgr(897)---{unattended-upgr}(1082)
Kill 用来杀死进程
一般kill -9 进程号
或者killall 杀死进程
Pkill -9 进程名
Pkill -t 可以踢出用户