title: Count the number of network packets in realtime (CLI)
body: <p>I want to count the number of network incoming/outgoing packets in realtime and in the CLI (I want to use the count to write shell script)</p>
  
  <p>I try to use 'tcpdump' and 'tsahrk' combined with pipeline, but it's doesn't work (I have little talent and learning).</p>
  
  <p>Finally,I found the command 'dumpcap', it's almost close to my need, here is dumpcap stdout</p>
  
  <pre><code>[root@hostname ~]# dumpcap -i eth0
  File: /tmp/wiresharkXXXXuTE8mU
  Packets: 31
  </code></pre>
  
  <p>When i use this command combined with 'grep', like this 'dumpcap -i eth0 | grep -o '[0-9]*' to filter the number in stdout(31),but it's still doesn't work.</p>
  
  <p>Is their any way to solve this or any idea for this ??</p>
  
  <p><strong>Thank you very much for your attention to this matter.</strong></p>