cheatsheet
Find which process is using a specific port 8080:
lists processes listening on TCP port 8082, showing clean output
| Option | What It Does |
|---|---|
lsof |
Lists open files (including network sockets) |
-n |
Don’t resolve IPs to hostnames (faster, no DNS delay) |
-P |
Don’t convert port numbers to names (e.g. show 8082 instead of us-cli) |
-iTCP:8082 |
Filter: only show TCP connections on port 8082 |
-sTCP:LISTEN |
Filter: only show listening sockets (not established connections) |
detailed information about the process with PID ( using wide output (no truncation).)
-ww: Show full command line without cutting off arguments (double w means no truncation at all)