How to add line numbers to a text file?

WU SHI-KUEI skwu at boulder.Colorado.EDU
Tue Dec 4 03:14:41 AEST 1990


With System V you have several choices for numbering lines in text files,
none of which use sed, awk, perl etc., etc.:

1. If the document will be formatted with n/troff, turn on line numbering
   with the .nm request.

2. If the document has been formatted and is paginated, 'pr -tn file' will
   do just fine if you don't mind having all lines numbered.

3. The line numbering filter 'nl' offers all sorts of options worth
   exploring.

Regardless of your choice, RTFM.



More information about the Comp.unix.questions mailing list