List open files by process
Show all files (sockets, regular, pipes) opened by nginx
lsof -p $(pgrep nginx) | head -30
- tool
- lsof19 commands
More lsof commands
-
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
-
lsof | grep '(deleted)'Find files deleted but still held open by processes (disk bloat)
-
ss -tlnpShow TCP listening ports with process names