文件类型:
命令:
lsof
结果:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
init 1 root cwd DIR 252,1 4096 2 /
init 1 root rtd DIR 252,1 4096 2 /
init 1 root txt REG 252,1 150352 131105 /sbin/init
init 1 root mem REG 252,1 66432 655392 /lib64/libnss_files-2.12.so
init 1 root mem REG 252,1 1924768 655376 /lib64/libc-2.12.so
init 1 root DEL REG 252,1 655363 /lib64/libgcc_s-4.4.7-20120601.so.1;5af8ee7f
init 1 root mem REG 252,1 44472 655404 /lib64/librt-2.12.so
init 1 root mem REG 252,1 143280 655400 /lib64/libpthread-2.12.so
init 1 root mem REG 252,1 265728 655457 /lib64/libdbus-1.so.3.4.0
命令:
lsof /usr/bin/nginx
结果:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 1557 root txt REG 252,1 6302521 1324371 /usr/local/nginx/sbin/nginx
nginx 32269 upfor txt REG 252,1 6302521 1324371 /usr/local/nginx/sbin/nginx
nginx 32270 upfor txt REG 252,1 6302521 1324371 /usr/local/nginx/sbin/nginx
命令:
lsof +D /opt/gogs/
结果:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gogs 813 git cwd DIR 252,1 4096 786619 /opt/gogs
gogs 813 git txt REG 252,1 33034400 788325 /opt/gogs/gogs
gogs 813 git 1w REG 252,1 13908 788732 /opt/gogs/log/gogs.log
gogs 813 git 2w REG 252,1 13908 788732 /opt/gogs/log/gogs.log
gogs 813 git 3w REG 252,1 13908 788732 /opt/gogs/log/gogs.log
gogs 813 git 5w REG 252,1 4173 786609 /opt/gogs/log/xorm.log
上一个教程:linux常用命令—find
下一个教程:linux 系统状态命令