【发布时间】:2026-02-09 00:00:01
【问题描述】:
我正在使用lsof 查找描述中包含/var/ 的所有进程。
[root@localhost ~]# lsof | grep /var/ | less
systemd 1 root 105u unix 0xffff9b25fae49680 0t0 21311 /var/run/cups/cups.sock type=STREAM
systemd 1 root 134u unix 0xffff9b25f509cd80 0t0 21334 /var/run/libvirt/virtlogd-sock type=STREAM
systemd 1 root 135u unix 0xffff9b25fae49f80 0t0 21315 /var/run/.heim_org.h5l.kcm-socket type=STREAM
systemd 1 root 137u unix 0xffff9b25fae48d80 0t0 21318 /var/run/libvirt/virtlockd-sock type=STREAM
polkitd 745 polkitd mem REG 8,3 10406312 2107847 /var/lib/sss/mc/initgroups
polkitd 745 polkitd mem REG 8,3 6406312 2107846 /var/lib/sss/mc/group
我现在正在尝试使用以下命令杀死所有这些进程:
kill -9 $(lsof | grep /var/)
但出现错误:
-bash: kill: root: arguments must be process or job IDs
-bash: kill: 8w: arguments must be process or job IDs
-bash: kill: REG: arguments must be process or job IDs
-bash: kill: 8,3: arguments must be process or job IDs
【问题讨论】: