lsof - list open files.
List all open files:
lsof
List open files of a specific user:
lsof -u john
List all network connections:
lsof -i
List processes running on specific port:
lsof -i TCP:22
List IPv4 open files:
lsof -i 4
List IPv6 open files:
lsof -i 6
List open files of TCP Port ranges 1-1024:
lsof -i TCP:1-1024
Search by PID:
lsof -p 1234