views:

34

answers:

1

I want to read a long text file in two-column format on my terminal. This means that the columns must be page-aware, so that text at the bottom of the first column continues at the top of the second column, but text at the bottom of the second column continues at the beginning of the first column after a page-down.

I tried column and less to get this result, but with no luck. If I pipe the text into column, it produces two columns but truncates the text before it reaches the end of the file. And if I pipe the output of column into less, it also reverts back to single-column.

a2ps does what I want in the way of reformatting, but I would rather have the output in pure plain text, readable from the terminal, rather than a PostScript file that I would need to read in a PDF reader.

+1  A: 

You can use pr for this, eg.

ls /usr/src/linux/drivers/char/ | pr -2 |less
Hasturkun