当我在做lsof -l
时,它会显示所有打开的文件描述符(~180000),但是当我检查时lsof -lp pid
只显示~1000。我知道pid pid
的进程打开了大约170000个文件描述符。
以下是日志:
root@riak:/proc/3238# lsof -l | grep 3238 | wc -l
172923
root@riak:/proc/3238# lsof -lp 3238 | wc -l
1075
root@riak:/proc/3238# ls -la | wc -l
44
root@riak:/proc/3238# ls -la fd | wc -l
924
为什么会有这样的差异?