知乎專欄 | 多維度架構 | 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者” |
組合參數
# lsof -a -c bash -u root COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME bash 1394 root cwd DIR 8,2 4096 4849665 /root bash 1394 root rtd DIR 8,2 4096 2 / bash 1394 root txt REG 8,2 938768 3671557 /bin/bash bash 1394 root mem REG 8,2 156872 3014902 /lib64/ld-2.12.so bash 1394 root mem REG 8,2 1922152 3014903 /lib64/libc-2.12.so bash 1394 root mem REG 8,2 22536 3014911 /lib64/libdl-2.12.so bash 1394 root mem REG 8,2 138280 3018719 /lib64/libtinfo.so.5.7 bash 1394 root mem REG 8,2 65928 3017998 /lib64/libnss_files-2.12.so bash 1394 root mem REG 8,2 26060 2632051 /usr/lib64/gconv/gconv-modules.cache bash 1394 root mem REG 8,2 99158576 2648204 /usr/lib/locale/locale-archive bash 1394 root 0u CHR 136,7 0t0 10 /dev/pts/7 bash 1394 root 1u CHR 136,7 0t0 10 /dev/pts/7 bash 1394 root 2u CHR 136,7 0t0 10 /dev/pts/7 bash 1394 root 255u CHR 136,7 0t0 10 /dev/pts/7
每個5秒刷新一次
# lsof -c init -a -r5
列出www用戶的所有活躍的網絡連接埠 [root@netkiller ~]# lsof -a -u www -i 列出被sshd進程所打開的所有IPV4網絡相關檔案 [root@netkiller ~]# lsof -i 4 -c sshd -a 列出被root用戶所打開的所有TCP和IPV4網絡相關檔案 [root@netkiller ~]# lsof -i 4 -i tcp -u root -a