Pt-align,
The pt-align function is very simple. It outputs the output of other tools by column.
Usage:
Pt-align [FILES]
If no file is specified, the standard input content is read by default.
For example, if the output of common vmstat is used, the reading experience is not user-friendly.
# vmstat 2 5procs -----------memory---------- ---swap-- -----io---- -system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 8948 18762860 628844 3925456 0 0 1 22 0 0 0 0 100 0 0 0 0 8948 18762484 628844 3925456 0 0 0 0 174 265 0 0 100 0 0 0 0 8948 18762936 628844 3925452 0 0 0 0 217 312 0 0 100 0 0 1 0 8948 18762424 628844 3925452 0 0 0 0 218 475 0 0 100 0 0 0 0 8948 18762700 628844 3925448 0 0 0 0 181 278 0 0 100 0 0
In this case, you can use pt-align for processing.
# vmstat 2 5 | pt-align r b swpd free buff cache si so bi bo in cs us sy id wa st2 0 8948 18762356 628844 3925436 0 0 1 22 0 0 0 0 100 0 00 0 8948 18759116 628844 3925428 0 0 0 0 298 352 0 0 100 0 00 0 8948 18759160 628844 3925428 0 0 0 0 206 320 0 0 100 0 00 0 8948 18759052 628844 3925432 0 0 0 0 71 176 0 0 100 0 01 0 8948 18758924 628844 3925436 0 0 0 0 158 433 0 0 100 0 0