Binaries and libs of a PID
Show only mapped executable and shared libs; -a ANDs the filters, great after a deploy
lsof -p <pid> -a -d txt,mem
- tool
- lsof19 commands
More lsof commands
-
lsof -nP -p <pid> | wc -lQuick fd count to spot leaks vs ulimit -n; faster: ls /proc/<pid>/fd | wc -l
-
lsof -p $(pgrep nginx) | head -30Show all files (sockets, regular, pipes) opened by nginx
-
lsof -i :8080Find which process is listening on port 8080
-
lsof -i -n -PShow all open network connections without DNS resolution
-
lsof +D /var/logShow all processes with open files under /var/log