Difference between revisions of "Netstat"

From Hackepedia
Jump to navigationJump to search
m
 
Line 6: Line 6:
 
If I wanted to see how many bytes flow through my interface and see this at an interval of 1 second I would type:
 
If I wanted to see how many bytes flow through my interface and see this at an interval of 1 second I would type:
 
   
 
   
  $ netstat -nb -I pppoe0 -w 1
+
  $ netstat -I pppoe0 -w 1
 
  pppoe0 in          pppoe0 out          total in          total out       
 
  pppoe0 in          pppoe0 out          total in          total out       
 
     bytes              bytes            bytes              bytes       
 
     bytes              bytes            bytes              bytes       
Line 15: Line 15:
  
 
  $ netstat -na
 
  $ netstat -na
...
 

Latest revision as of 18:05, 8 April 2006

netstat displays network statistics. The most popular usage is to display your current routing table:

$ netstat -rn

If I wanted to see how many bytes flow through my interface and see this at an interval of 1 second I would type:

$ netstat -I pppoe0 -w 1
pppoe0 in          pppoe0 out          total in           total out      
    bytes               bytes             bytes               bytes      
1396887118           221757068        2813821922           475500976      
    16620                 888             33492                2168      

One can also see what existing connections/sockets are open:

$ netstat -na