Sometimes the output of commands or the information in log files is not formatted very well which makes it difficult to understand.
For example, here are the top ten lines of a CPU benchmark log file:
$ head benchmark.log
#round load sleep performance powersave percentage
0 50000 50000 53105 56467 94.045
1 100000 100000 103600 109100 94.959
2 150000 150000 153215 159666 95.960
3 200000 200000 203750 210340 96.867
4 250000 250000 254398 262572 96.887
5 300000 300000 303918 312696 97.193
6 350000 350000 354797 363481 97.611
7 400000 400000 404626 413001 97.972
The data does not align with the labels on the top line making it harder to parse. If we pass this into column as standard input column
will neatly print the same information in understandable columns:
$ head benchmark.log | column -t
#round load sleep performance powersave percentage
0 50000 50000 53105 56467 94.045
1 100000 100000 103600 109100 94.959
2 150000 150000 153215 159666 95.960
3 200000 200000 203750 210340 96.867
4 250000 250000 254398 262572 96.887
5 300000 300000 303918 312696 97.193
6 350000 350000 354797 363481 97.611
7 400000 400000 404626 413001 97.972
The -t
option instructs column to print the output into a table and that is how I always use it.