3 ms·
Something to watch out for with nl is that by default it doesn't number empty lines. e.g.: $ printf 'one\n\nthree\n' | nl 1 one 2 three Set -ba
by i15e 3y ago
Something to watch out for with nl is that by default it doesn't number empty lines. e.g.:
$ printf 'one\n\nthree\n' | nl
1 one
2 three
Set -ba to enable numbering all lines.
For this use case I usually end up running cat -n instead since I find it easier to remember.