列出某个命令打开的所有文件

・1 分钟阅读

列出某个命令打开的所有文件

lsof -c dhcpd
列出特定命令打开的所有文件,基于它的命令名称。
示例输出
[root@kxct1 prod]# lsof -c dhcpd
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
dhcpd 15857 root cwd DIR 8,2 4096 2 /
dhcpd 15857 root rtd DIR 8,2 4096 2 /
dhcpd 15857 root txt REG 8,2 678400 475389 /usr/sbin/dhcpd
dhcpd 15857 root mem REG 8,2 105080 1033986 /lib64/ld-2.3.4.so
dhcpd 15857 root mem REG 8,2 1493186 1033987 /lib64/tls/libc-2.3.4.so
dhcpd 15857 root mem REG 8,2 56902 1032222 /lib64/libnss_files-2.3.4.so
dhcpd 15857 root 0w REG 8,17 63282 3287672 /var/lib/dhcp/dhcpd.leases
dhcpd 15857 root 3u unix 0x0000010110312680 717501116 socket
dhcpd 15857 root 4u raw 717501119 00000000:0001->00000000:0000 st=07
dhcpd 15857 root 6u IPv4 717501138 UDP *:bootps
dhcpd 15857 root 7u sock 0,4 717501137 can't identify protocol
Hujiuxiang profile image