How to view line numbers in vi

When editing large files in vi or vim line numbers become very important.

This is how you turn on/off line numbers in vi or vim.

Turn on line numbers

While vi is in edit mode and not inserting type the following

:set number

Turn off line numbers

While vi is in edit mode and not inserting type the following

:set nonumber

Screenshots