nl [options] [files]
-b [a|t|n|p R] Prepend numbers to all lines (a), nonblank lines (t), no lines (n), or only lines that contain regular expression R. (Default=a) -v N Begin numbering with integer N. (Default=1) -i N Increment the number by N for each line, so for example, you could use odd numbers only (-i 2) or even numbers only (-v 2 -i 2). (Default=1) -n [ln|rn|rz] Format numbers as left-justified (ln), right-justified (rn), or right-justified with leading zeros (rz). (Default=ln) -w N Force the width of the number to be N columns. (Default=6) -s S Insert string S between the line number and the text. (Default=Tab)
⤍ cat mytext Once upon a time, there was a little operating system named Linux, which everybody loved. ⤍ nl mytext 1 Once upon a time, there was 2 a little operating system named 3 Linux, which everybody loved.