显示Linux进程打开了哪些文件? 用lsof命令

1、lsof abc.txt --> 显示开启文件 abc.txt的进程。

2、lsof -c abc  ---> 显示abc进程现在打开的文件。

3、lsof -c -p 1234 ---> 显示进程1234打开的文件。

4、lsof +d /usr/local   ---> 显示目录下被进程打开的文件

5、lsof -i:53 ---> 显示有哪些进程占用了53号端口,用于检查dns服务启动失败时的检查。

原文地址:https://www.cnblogs.com/zhouhaibing/p/7868975.html