Solved

netstat -na | find "8080" i see all opened and then i need to count,how can i see the nr. of how many they are?

Posted on 2016-09-26
4
176 Views
Last Modified: 2016-10-01
netstat -na | find "8080" i see all and then i need to count,how can i see the nr. of how many they are?

for example are 20  i want to see them and then the number: 20

TCP    192.168.1.110:48049    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48050    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48051    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48052    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48053    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48054    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48055    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48056    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48057    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48058    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48059    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48060    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48061    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48062    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48063    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48064    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48065    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48066    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48067    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48068    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48069    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48070    5.2.250.112:8080       ESTABLISHED
TCP    192.168.1.110:48071    5.2.250.112:8080       ESTABLISHED

Open in new window

0
Comment
Question by:john lambert
  • 2
4 Comments
 
LVL 26

Expert Comment

by:Dr. Klahn
ID: 41815500
drklahn@www:~$ netstat -na|grep 80
tcp        0     52 192.168.0.209:22        192.168.0.200:3480      ESTABLISHED
tcp6       0      0 :::80                   :::*                    LISTEN
drklahn@www:~$ netstat -na|grep -c 80
2

Open in new window


Note that this will lie to you if the search string appears in other contexts, as in the example above.
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 41815751
netstat -na | find "8080" /c

will display the number of matching lines only.

If you want to see   the regular output along with the count run the comtmand twice, with and without the /c switch.
1
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 41815758
The Unix tool "wc" which can count characters, words and lines is also available for Windows, see here:
http://gnuwin32.sourceforge.net/packages/coreutils.htm
0
 

Author Closing Comment

by:john lambert
ID: 41824556
thank you...
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vSphere 5.5 - move subnet to another data center? 2 20
How to read network slash info 7 50
exclude a user from a deny permisssion 4 61
Cisco Edge Routers for BGP 6 55
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question