Skip to main content
added 7 characters in body
Source Link
Paul_Pedant
  • 9.4k
  • 3
  • 24
  • 27

top uses ncurses interactively, toso the output stream is full of cursor movements. However, it has a -b (batch) option that prints the data every time-interval. So you could parse that with awk. If you don't need all the processes (which it does because it does not have a window size in -b mode) there are options to tailor almost all the outputs. And it does the interval timing for you too, so you don't need to keep re-running the process.

top uses ncurses interactively, to the output is full of cursor movements. However, it has a -b (batch) option that prints the data every time-interval. So you could parse that with awk. If you don't need all the processes (which it does because it does not have a window size in -b mode) there are options to tailor almost all the outputs. And it does the interval timing for you too, so you don't need to keep re-running the process.

top uses ncurses interactively, so the output stream is full of cursor movements. However, it has a -b (batch) option that prints the data every time-interval. So you could parse that with awk. If you don't need all the processes (which it does because it does not have a window size in -b mode) there are options to tailor almost all the outputs. And it does the interval timing for you too, so you don't need to keep re-running the process.

Source Link
Paul_Pedant
  • 9.4k
  • 3
  • 24
  • 27

top uses ncurses interactively, to the output is full of cursor movements. However, it has a -b (batch) option that prints the data every time-interval. So you could parse that with awk. If you don't need all the processes (which it does because it does not have a window size in -b mode) there are options to tailor almost all the outputs. And it does the interval timing for you too, so you don't need to keep re-running the process.