Format Output of bash into columns

Michael Schwendt fedora at wir-sind-cool.org
Sat Nov 27 15:00:35 UTC 2004


On Fri, 26 Nov 2004 17:37:42 -0600, Mike Vanecek wrote:

> I have looked through my books and googled ... Tried serveral things without
> success ...
> 
> I would like to run the output of a bash command that produces 1 field per
> line output through sort and then output in 3 columns. I have looked at
> printf, fmt, column, and so on.
> 
> For example,
> 
> rpm -qa | sort 2>&1 |  column -c 2 
> 
> rpm -qa | sort |  column -c 2

Option -c sets the screen width, i.e. the number of horizontal
characters, where one character = one column. So, you don't want
"-c 2", but something way bigger than 2, so two RPM package names
always fit onto the screen horizontally.

-- 
Fedora Core release 3 (Heidelberg) - Linux 2.6.9-1.681_FC3
loadavg: 1.23 1.19 1.07




More information about the redhat-list mailing list