Numbering lines in emacs
A few ways to add line numbers in emacs:
M-x linum-mode <RET>will annotate the buffer with line numbers. (These numbers are decoration, in the "fringe" rather than part of the buffer text.) Also see Linum Plus.
C-x r Nwill insert line numbers into the selected region. (These numbers are content, they are added to the text of the buffer.)
M-x line-number-mode <RET>show the line number of the current line in the modeline.
C-x lwill report (in the minibuffer) the total number of lines in the current buffer as well as the number of lines before and after the cursor
M-x what-line <RET>will report (in the minibuffer) the current line number
Also see emacswiki.org/LineNumbers.