How to display the number of lines in vi or vim editor
Temporary display
In the last line mode of vi or vim editor, enter " :set number "
Turn off temporary display
Similarly, in the last line mode of the vi or vim editor, enter set nonumber " :set nonumber "
Permanently display line numbers
Command vim ~/.vimrc
input " set number " and then " wq " to save and exit.
After entering the file again, the line number will be displayed directly