1.检查所有监听端口
#netstat -tln | awk 'NR>2{sub(".*:","",$4);print $4}'
2.检查所有监听端口并排序去重
#netstat -tln | awk 'NR>2{sub(".*:","",$4);print $4}' | sort | uniq
1.检查所有监听端口
#netstat -tln | awk 'NR>2{sub(".*:","",$4);print $4}'
2.检查所有监听端口并排序去重
#netstat -tln | awk 'NR>2{sub(".*:","",$4);print $4}' | sort | uniq