ifstat
Monitor network interface traffic statistics
TLDR
View network interface statistics since last query
View network interface statistics since last boot
View error rate
SYNOPSIS
ifstat [options] [interface...] [interval [count]]
PARAMETERS
-a
Show statistics for all network interfaces, including inactive ones.
-l
List interfaces in a single line, reducing the verbosity of the output.
-n
Do not resolve hostnames in output, if applicable (less common for ifstat).
-t
Display a timestamp for each line of output, showing when the statistics were recorded.
-T
Display total bandwidth across all monitored interfaces in an additional summary line.
-p
Provide parseable output, making it easier for scripts or other programs to process the data.
-i interval
Set the sampling interval in seconds (default is 1 second). Subsequent arguments will be treated as count and interfaces.
-S unit
Specify the unit for output. Common units include 'k' for Kilobytes/sec, 'm' for Megabytes/sec, 'g' for Gigabytes/sec.
-q
Quiet mode; suppress the header lines, showing only the data.
-z
Do not show lines for interfaces with zero traffic; only display active interfaces with data.
-h
Display a help message and exit.
-v
Display version information and exit.
DESCRIPTION
ifstat is a command-line utility used to display real-time network interface bandwidth usage statistics. It provides a quick overview of traffic flowing through network interfaces, showing incoming and outgoing data rates. This tool is similar in concept to vmstat or iostat but focuses specifically on network traffic.
It can monitor all active interfaces or specific ones defined by the user. The output is typically updated at regular intervals, making it useful for monitoring network activity over time. ifstat is lightweight and provides a clear, concise view of network throughput, helping administrators identify network bottlenecks or unusual traffic patterns. It's particularly useful for quickly assessing network health or debugging connectivity issues by observing live traffic.
CAVEATS
ifstat provides instantaneous snapshots of network activity; it is not designed for long-term data collection or historical trend analysis. For persistent logging or advanced graphing, dedicated monitoring systems or tools like sar are more appropriate. Its output can become verbose on systems with many interfaces unless specific ones are selected or filters like -z are used.
OUTPUT FORMAT
The default output of ifstat typically shows columns for the interface name (IFACE), incoming traffic (In), and outgoing traffic (Out). Traffic is usually measured in bytes per second by default, though this can be adjusted with the -S option. For example:
IFACE In Out
lo 0.00 0.00
eth0 10.50k 2.30k
When -t is used, a timestamp column is added. When -T is used, a total line summarizing all monitored interfaces is added at the bottom of the output.
USAGE WITH INTERVAL AND COUNT
You can specify a sampling interval and a count of iterations after the options and interface names. For example, to update every 2 seconds, for a total of 5 times, for the eth0 interface:ifstat eth0 2 5
If only one number is provided, it is treated as the interval, and ifstat will run indefinitely until interrupted (e.g., with Ctrl+C). If no interfaces are specified, these arguments apply to all active interfaces.
HISTORY
ifstat is a simple, single-purpose command-line utility primarily developed for the Linux ecosystem. It provides a quick and lightweight way to monitor network throughput in real-time, focusing on active interfaces. Unlike more complex networking tools that have evolved significantly (e.g., netstat being superseded by ss and ip), ifstat's core functionality has remained largely consistent, reflecting its clear and focused objective of displaying live network statistics directly in the terminal.