我不了解lsof命令的输出。
当我写
lsof -p PID
我得到4行,当我写
lsof | grep PID
我得到数百行。
它不应该返回相同的结果吗?
谢谢你的回复。这是输出。看起来是子流程,还是这个任务是什么意思?
lsof -p 29076
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 29076 pr cwd unknown /proc/29076/cwd (readlink: Permission denied)
java 29076 pr rtd unknown /proc/29076/root (readlink: Permission denied)
java 29076 pr txt unknown /proc/29076/exe (readlink: Permission denied)
java 29076 pr NOFD /proc/29076/fd (opendir: Permission denied)
lsof |grep 29076|head -20
java 29076 pr cwd unknown /proc/29076/cwd (readlink: Permission denied)
java 29076 pr rtd unknown /proc/29076/root (readlink: Permission denied)
java 29076 pr txt unknown /proc/29076/exe (readlink: Permission denied)
java 29076 pr NOFD /proc/29076/fd (opendir: Permission denied)
java 29076 300 pr cwd unknown /proc/29076/task/300/cwd (readlink: Permission denied)
java 29076 300 pr rtd unknown /proc/29076/task/300/root (readlink: Permission denied)
java 29076 300 pr txt unknown /proc/29076/task/300/exe (readlink: Permission denied)
java 29076 300 pr NOFD /proc/29076/task/300/fd (opendir: Permission denied)
java 29076 329 pr cwd unknown /proc/29076/task/329/cwd (readlink: Permission denied)
java 29076 329 pr rtd unknown /proc/29076/task/329/root (readlink: Permission denied)
java 29076 329 pr txt unknown /proc/29076/task/329/exe (readlink: Permission denied)
java 29076 329 pr NOFD /proc/29076/task/329/fd (opendir: Permission denied)
java 29076 330 pr cwd unknown /proc/29076/task/330/cwd (readlink: Permission denied)
java 29076 330 pr rtd unknown /proc/29076/task/330/root (readlink: Permission denied)
java 29076 330 pr txt unknown /proc/29076/task/330/exe (readlink: Permission denied)
java 29076 330 pr NOFD /proc/29076/task/330/fd (opendir: Permission denied)
java 29076 331 pr cwd unknown /proc/29076/task/331/cwd (readlink: Permission denied)
java 29076 331 pr rtd unknown /proc/29076/task/331/root (readlink: Permission denied)
java 29076 331 pr txt unknown /proc/29076/task/331/exe (readlink: Permission denied)
java 29076 331 pr NOFD /proc/29076/task/331/fd (opendir: Permission denied)