mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-22 21:52:12 +01:00
cheatsheets/netstat: Which process is listening on a port
This commit is contained in:
parent
64cba079f9
commit
50fd4c6638
1 changed files with 6 additions and 0 deletions
|
@ -3,3 +3,9 @@ sudo netstat -lnptu
|
||||||
|
|
||||||
# To view routing table (use -n flag to disable DNS lookups):
|
# To view routing table (use -n flag to disable DNS lookups):
|
||||||
netstat -r
|
netstat -r
|
||||||
|
|
||||||
|
# Which process is listening to port <port>
|
||||||
|
netstat -pln | grep <port> | awk '{print $NF}'
|
||||||
|
|
||||||
|
Example output: 1507/python
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue