Search code examples
command-linenetstat

Confusion regarding the exact function of `netstat -e`


I have been meaning to use this command netstat -e for a script. I earlier thought it gives the data count of bytes uploaded/downloaded during a particular session when it is connected to the network and the data is reset for every session/profile. That however, doesn't seem to be the case.

What does the command do exactly, i.e. what's it its data tabulating mechanism? Per-session or per-day or per-boot or something else?


Solution

  • Unix/Linux

    Man pages are your best friend in this instance...

    http://www.unix.com/man-page/linux/0/netstat/

    http://www.e-reading.link/htmbook.php/orelly/networking/puis/ch17_05.htm

    Windows

    If you mean netstat for Windows check out this link...

    windows netstat info

    Also, it is best to create a written record of the connections that are made over some period of time. The command can then be written

    netstat -b 5 >> C:\connections.txt
    

    Note that as written, this command will run with five-second intervals until stopped by entering Ctrl+c, which is a general command to exit. (Some reports say that this can be fairly CPU intensive so it may cause a slower, single-core machine to run sluggishly. It was not noticeable on my dual-core machine.)

    From: here