From Hackepedia
Jump to navigationJump to search

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