Ubuntu netstat Command Guide
The netstat command is used to display network status information, including network connections, routing tables, interface statistics, etc. In Ubuntu, you can use the netstat command through the terminal.
The basic format of the netstat command is as follows:
netstat [options]
Commonly used options for netstat include:
- -t: displays TCP connections.
- -u: Display UDP connections.
- -n: display the IP address and port number without performing DNS resolution.
- Display all connections, including both listening and non-listening connections.
- -r: Display the routing table.
- “Display network interface information”
- -p: Display the PID and program name.
For example, to display all TCP connections, you can use the following command:
netstat -t
To display detailed information about all connections, you can use the following command:
netstat -an
To display routing table information, you can use the following command:
netstat -r
You can find more options and parameters for using the netstat command by checking the help document with the man netstat command.