------------------------------------------------------------------------ rows <-> columns ------------------------------------------------------------------------ Say you have a row of numbers. $ echo {01..09} 01 02 03 04 05 06 07 08 09 It is easy to convert this to a column $ echo {01..09} | xargs -n 1 01 02 03 04 05 06 07 08 09 Consider the opposite case where you have a column $ seq 9 1 2 3 4 5 6 7 8 9 The simplest way to convert this to a row is $ seq 10 | column To convert to a row you a choice of delimeters (-d; but limited to one character) $ seq 9 | paste -s -d " " - %pretty clever (not discovered by me) $ paste -s -d " " <(seq 9) 1 2 3 4 5 6 7 8 9 $ seq 9 | sed -n '1h;1!H;${x;s/\n/,/gp;}' %comma-separated 1,2,3,4,5,6,7,8,9 $ ifs=":" %you can set the field separator $ seq 9 | sed -n '1h;1!H;${x;s/\n/'$ifs'/gp;}' 1:2:3:4:5:6:7:8:9 ------------------------------------------------------------------------ An unorthodox solution ------------------------------------------------------------------------ This solution makes use of the faca that command substitution gobbles up "\n". $ echo $(seq 5) 1 2 3 4 5 $ seq 5 > a $ cat a 1 2 3 4 5 $ echo $(cat a) 1 2 3 4 5 $ cat b 1 a 2 b 3 c 4 d 5 e $ echo $(cat b) 1 a 2 b 3 c 4 d 5 e