netstat命令
用来打印网络系统信息
参数:
-t或--tcp:显示TCP传输协议的连线状况; -u或--udp:显示UDP传输协议的连线状况; -n或--numeric:直接使用ip地址,而不通过域名服务器; -l或--listening:显示监控中的服务器的Socket; -p或--programs:显示正在使用Socket的程序识别码和程序名称; -a或--all:显示所有连线中的Socket;
[root@centos1 ~]# netstat -ntupl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1294/master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1109/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1294/master
tcp6 0 0 :::22 :::* LISTEN 1109/sshd
udp 0 0 0.0.0.0:68 0.0.0.0:* 748/dhclient
udp 0 0 127.0.0.1:323 0.0.0.0:* 588/chronyd
udp6 0 0 ::1:323 :::* 588/chronyd