0
iftop -t -L1 -s1

Output:

enter image description here

iftop -t -L1 -s1 | grep "Total send and receive rate:"

Output:

enter image description here

How can I grep just the "Total send and receive state:" line?

HBruijn
  • 77,029
  • 24
  • 135
  • 201
JustAGuy
  • 639
  • 3
  • 23
  • 38

1 Answers1

1

It seems that iftop is writing the unwanted lines to STDERR. To remove those for your grep use a command line as follows.

iftop -t -L1 -s1 2> /dev/null | grep "Total send and receive rate:"
Thomas
  • 4,225
  • 5
  • 23
  • 28