bmon with format option quitafter argument

pl flag

I know this might be a stupid question, but as I am new to Ubuntu I don't even know how google it.

I want to show network stats using bmon in a special format so I can read it later with another script.

I read through help, and I was able to achieve most of my need using this command:

bmon -p 'ens3' -r 3 -o format:fmt='rx=$(attr:rx:bytes) tx=$(attr:tx:bytes)\n'

The problem with this command is that it keeps posting stats every x amount of seconds. I want it to only show stats once.

I found in the help that I can use quitafter:

root@domain:~# bmon -o format:help
format - Formatable Output

  Formatable ASCII output for scripts. Calls a drawing function for
  every item per node and outputs according to the specified format
  string. The format string consists of normal text and placeholders
  in the form of $(placeholder).

  Author: Thomas Graf <>

    fmt=FORMAT     Format string
    stderr         Write to stderr instead of stdout
    quitafter=NUM  Quit bmon after NUM outputs

But I can't make it work. I tried a lot of things:

bmon -p 'ens3' -r 3 -o format:quitafter=1:fmt='rx=$(attr:rx:bytes) tx=$(attr:tx:bytes)\n'
bmon -p 'ens3' -r 3 -o format:quitafter=1 fmt='rx=$(attr:rx:bytes) tx=$(attr:tx:bytes)\n'
bmon -p 'ens3' -r 3 -o format:fmt='rx=$(attr:rx:bytes) tx=$(attr:tx:bytes)\n' quitafter=1    
bmon -p 'ens3' -r 3 -o format:fmt='rx=$(attr:rx:bytes) tx=$(attr:tx:bytes)\n':quitafter=1

None worked.

Please help me, thanks.

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.