====== SED - Numbering - Number each line of a file (number on left, right-aligned) ====== sed = filename | sed 'N; s/^/ /; s/ *\(.\{6,\}\)\n/\1 /' ---- ===== Example ===== Running that command again this file: aaa bbb ccc returns: 1 aaa 2 bbb 3 ccc