Two command output

netstat -n | grep ESTAB |grep :80 | tee /dev/stderr | wc -l
Summarize established connections after netstat output. Using tee and /dev/stderr you can send one command output to terminal before executing wc so you can summarize at the bottom of the output.
Sample Output
tcp        0      0 10.0.10.200:80          148.63.119.16:63467     ESTABLISHED
tcp        0      0 10.0.10.200:80          124.53.232.196:46450     ESTABLISHED
tcp        0      0 10.0.10.200:80          44.53.132.192:46446     ESTABLISHED
tcp        0      0 10.0.10.200:80          74.67.40.31:63571        ESTABLISHED
tcp        0      0 10.0.10.200:80          48.211.53.20:53639      ESTABLISHED
tcp        0      0 10.0.10.200:80          48.211.53.21:42207      ESTABLISHED
tcp        0      0 10.0.10.200:80          89.218.19.62:41217      ESTABLISHED
tcp        0      0 10.0.10.200:80          77.67.4.68:38614        ESTABLISHED
tcp        0      0 10.0.10.200:80          92.122.188.102:36235    ESTABLISHED
tcp        0      0 10.0.10.200:80          92.122.188.94:34494     ESTABLISHED
tcp        0      0 10.0.10.200:80          23.72.224.124:37407     ESTABLISHED
tcp        0      0 10.0.10.200:80          23.3.13.212:61127       ESTABLISHED
12

3
2016-06-26 11:37:19

1 Alternatives + Submit Alt

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: