Column

From Leo's Notes
Revision as of 00:49, 30 December 2021 by Leo (talk | contribs) (Added categories and navbox)
This page was last edited on 30 December 2021, at 00:49.

Column is a utility that formats data into neat columns. Rather than relying on inserting the proper number of spaces or tabs, you can pipe your output through column to have the output look spectacular.

I added this page because I keep on forgetting how to print neat columns since I get it confused with col.

Usage

Just pipe whatever you want columnized through column -t.

% for i in apple orange banana pear ; do echo $i "\$0.00" ; done | column -t
apple   $0.00
orange  $0.00
banana  $0.00
pear    $0.00