How to show line number in vi editor

I believe everyone facing this problem before there is no line number show in the long configuration file. Example: below screenshot, there is an syntax error at line 27 and it will take sometime to identify that particular line.

Did your guys know we can display the line number in vi text editor

Below are the steps:

  1. Press the Esc key if you are currently in insert or append mode.
  2. Press : (the colon). The cursor should reappear at the lower left corner of the screen next to a : prompt.
  3. Enter the following command:

set number

4. A column of sequential line numbers will appear at the left side of the screen. Each line number references the text located directly to the right.


Leave a Reply

Your email address will not be published. Required fields are marked *