Shell Tool – How to Tablify Input Data

shell

A long time ago I remember using a command that makes its input into a nicely formatted table.

For example, for this input,

apple 1 100
orange 20 19
pineapple 1000 87
avocado 4 30

The output will be similar to this:

apple     1    100
orange    20   19
pineapple 1000 87
avocado   4    30

I'd like to know the name of this tool.

Best Answer

Use column -t. column is part of util-linux.

$ column -t <<END
> apple 1 100
> orange 20 19
> pineapple 1000 87
> avocado 4 30
> END
apple      1     100
orange     20    19
pineapple  1000  87
avocado    4     30