Find which process uses a local port.
Section: Ports and Socket Monitoring
Show process using port
bash
bash
lsof -i :5432Explanation
Find which process uses a local port.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Ports and Socket Monitoring
Show all TCP/UDP sockets with process info
List listening and connected sockets with owning processes.
Show established TCP connections
Inspect established connections and owning processes.
List open files for PID
Show files, sockets, and descriptors opened by a process.
List open files by process name
Show open files for processes matching a name prefix.
Find deleted files still open
Find processes keeping deleted files open and consuming disk.