$ nl tf 1 echo press cr 2 read cr 3 done The following example numbers only the lines that begin with a capital letter A (matching on the
regular expression /^A/).
filename is optional. $ nl -b p^A filename apple 1 Apple BANANA 2 Allspice strawberry It can be useful as an alternative to : $ cat somefile aaaa bbbb cccc dddc $ nl -ba somefile | grep cccc 3 cccc ==See also==