How to Show Line Numbers in Vi / Vim editor

Showing Line numbers in Vi /Vim Text editor would be very helpful when it comes to troubleshooting code errors in a file. This works on almost all Linux/UNIX distributions. Once you are in the edit file mode, Type while in edit mode ":set nu" OR ":set number" and then it will show you the Line numbers and  then you can jump to a specific line by typing ":number" or any line number you require.

 Before setting Line Numbers:

vi screen 1

After enabling Line numbers using :set nu (OR) :set number

vi screen 2

If you want edit specfic line, use ":number" i.e. ":10"or any line number required.

vi screen 3

If you encounter any errors during the process, let us know via Contact Us and will try our best to help.

Linux Related Articles . . .

To generate a SHA256 certficate in linux all you need to do is run this openssl command and you will...
This a very useful One liner command to insert IP and hostname into /etc/hosts file and is particularly useful when...
Its possible to use awk in Alias command. I did that by simply just modifying some parenthesis and there you...
Its possible to run a script via Alias command. All you need is to modify the .bashrc and then source...
This article will guide you on creating a custom Self-signed SSL Certificate in no time. For creating one you would...