Netstat Commands

?
R
Bash

Netstat command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships, within others.

1# View which ports a service is listening to
2`apt-get install net-tools`
3`netstat -taupn | grep syslog`
4
5# List all ports
6`netstat -a | more`
7`netstat -at`
8`netstat -au`
9
10# List Sockets which are in Listening State
11`netstat -l`
12`netstat -lt`
13`netstat -lu`
14
15# View all information on ports
16`netstat -s`
17
18# Check if Service is running
19`ps -A | grep rsyslog`
20
21# View all statistics for TCP, IP, ICMP, UDP Protocols on all ports
22`netstat -s`
23
24# Display PID and program names in netstat output using netstat -p
25`netstat -pt`
26
27# Tail -f netstat information
28`netstat -c`
29
30# Kernel routing information
31`netstat -r`
32
33# Which process is using a port
34`netstat -an | grep ':80'`
35
36# View all network interfaces
37`netstat -i`
38`netstat -ie`
39

Created on 1/31/2018