lsof (list open files)是一个列出当前系统打开文件的工具。在linux系统环境下,任何事物都可以以文件形式存在,通过文件不仅可以访问常规的数据,还可以访问网络连接和硬件。 适应条件:lsof访问的是核心文件和各种文件,所以必须以root用户的身份运行才能充分发挥其功能。 lsof [选项] [绝对路径的文件名]
显示示例
- [root@localhost ~]# lsof /usr/sbin/httpd
- COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
- httpd 6279 root txt REG 8,2 344112 415135 /usr/sbin/httpd
- httpd 6281 apache txt REG 8,2 344112 415135 /usr/sbin/httpd
- httpd 6282 apache txt REG 8,2 344112 415135 /usr/sbin/httpd
- httpd 6283 apache txt REG 8,2 344112 415135 /usr/sbin/httpd
- httpd 6284 apache txt REG 8,2 344112 415135 /usr/sbin/httpd
- httpd 6285 apache txt REG 8,2 344112 415135 /usr/sbin/httpd
- httpd 6286 apache txt REG 8,2 344112 415135 /usr/sbin/httpd
- httpd 6287 apache txt REG 8,2 344112 415135 /usr/sbin/httpd
- httpd 6288 apache txt REG 8,2 344112 415135 /usr/sbin/httpd
- httpd 6546 apache txt REG 8,2 344112 415135 /usr/sbin/httpd
|