Lsof
From Sysadmin
lsof is one of the swiss army knife tools. Every Unix sysadmin should have a good working knowledge of this tool.
Contents |
Examples
Filesystem
List files being accessed at or below a specified directory
lsof +D $DIRECTORY
Network
List network connections
lsof -i
List files in use by a different process
lsof -p 5432
This options allows multiple comma seperated processes:
lsof -p 5432,6543,7654
And negation by the use of ^.
lsof -p ^8765
