Tabular display in Linux terminal

A command I like in Linux is ‘column’. It allows the display of ordered data (typically CSV) in a tabular way in the Linux terminal.

For example, assume you have the following file:

$ cat data
server|location|usage|New York|web|Beijing|database|Sidney|nosql

You can display this file nicely as follows:

$ column -t -s '|' data
server               location  usage     New York  web   Beijing   database  Sidney    nosql

-t indicates that we want tabular display and -s specifies the separator we use. I like to use the pipe (‘|’) as data separator, but usually the semi colon (‘;’) is used for CSV data.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s