2014-09-11 14:38:56 +04:00
|
|
|
# netstat
|
|
|
|
|
2018-11-21 00:30:05 +03:00
|
|
|
> Displays network-related information such as open connections, open socket ports, etc.
|
2014-09-11 14:38:56 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- List all ports:
|
2014-09-11 14:38:56 +04:00
|
|
|
|
|
|
|
`netstat -a`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- List all listening ports:
|
2014-09-11 14:38:56 +04:00
|
|
|
|
|
|
|
`netstat -l`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- List listening TCP ports:
|
2014-09-11 14:38:56 +04:00
|
|
|
|
2015-12-28 10:48:19 +03:00
|
|
|
`netstat -t`
|
2014-09-11 14:38:56 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Display PID and program names:
|
2014-09-11 14:38:56 +04:00
|
|
|
|
2015-12-28 10:48:19 +03:00
|
|
|
`netstat -p`
|
2014-09-11 14:38:56 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- List information continuously:
|
2014-09-11 14:38:56 +04:00
|
|
|
|
2015-12-28 10:48:19 +03:00
|
|
|
`netstat -c`
|
2016-01-14 16:52:25 +03:00
|
|
|
|
2016-01-15 12:21:16 +03:00
|
|
|
- List routes and do not resolve IP to hostname:
|
2016-01-14 16:52:25 +03:00
|
|
|
|
2016-01-14 17:25:17 +03:00
|
|
|
`netstat -rn`
|
2016-01-29 17:26:33 +03:00
|
|
|
|
|
|
|
- List listening TCP and UDP ports (+ user and process if you're root):
|
|
|
|
|
|
|
|
`netstat -lepunt`
|
2018-11-21 00:30:05 +03:00
|
|
|
|
|
|
|
- Print the routing table:
|
|
|
|
|
|
|
|
`netstat -nr`
|