Unix: show line numbers along with file content 

Joined:
04/09/2007
Posts:
753

June 09, 2007 02:26:07    Last update: June 09, 2007 02:26:07
Use the nl command to display line numbers for each line in a file:

nl file1      # display contents of file1, but prepend each line with line number

nl -ba file1  # same as above, except that line numbers are also shown for empty lines here
Share |
| Comment  | Tags