1.数组
abc[1]= “xiaohong"
abc : 为数组名称
[1] : 为数组元素下标,可以理解为数组的第1个元素
xiaohong : 元素内容
2.命令
# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 248 192.168.1.2:22 192.168.2.3:59343 ESTABLISHED
# netstat -an|awk '/^tcp /{++S[$NF]} END {for(a in S) print a,S[a]}'
LISTEN 5
ESTABLISHED 1