Sometimes you really need to see the number of the line where you are while editing a text file, if you like vi / vim, this will help you how to turn on and off the numbering of lines.

Turn on the number display on vim

While editing the file enter:

:set nu

or

:set number

Turn off the number display on vim

While editing the file enter:

:set nonu

or

:set nonumber

Printing the numbers

Sometimes you want to print those numbers, specially if you are debugging software, so enter:

:set printoptions=number:y

Note: Remember that you can always put these commands in your $HOME/.vimrc in order to have them as defaults