Linux Many services are related to the network, when the service is not available or the start port is occupied, or is blocked by the firewall, you need to query the network-related problems, netstat command will only use one or two parameters here, a good study.
A few common options:
- -A (All) displays all options and does not show listen related by default
- -T (TCP) displays only TCP-related options
- -U (UDP) displays only UDP-related options
- -N refuses to display aliases, showing all numbers converted to numbers
- -l list only service status in Listen (listening)
- -C executes the netstat command every other fixed time
- -S display statistics for the network
- -p lists the PID of the program, which is useful
- -R Display Routing table
- -e Display Other outreach information
Use case:
1 View all TCP ports
$ netstat -at
2 View all TCP ports on listening
$ netstat -lt
3 Finding the port of the SSH service
$ netstat -alpt|grep ssh
4 Display network card and NIC information
$ netstat -ie
5 View all routing tables in TCP connections
# netstat -ant
6 View only monitored connections, as well as PID information (common)
# NETSTAT-TNLP
7 View TCP connections per second
# netstat -ct
8 See if a service is running
netstat -alpnt|grep ssh
There are more commonly used in adding.
This article from the "Orangleliu Notebook" blog, reproduced please be sure to keep this source http://blog.csdn.net/orangleliu/article/details/41044879
Orangleliu
[Linux]linux command to learn-netstat