netstat -anp | grep 'CONNECTED'|awk 'END{print NR}' 或者這樣
2017-04-08
netstat -anp | grep 'LISTEN'|nl|awk 'END{print $1}' 這樣感覺更容易
2017-04-08