Setting line numbers on can be done using:
However when you need to do this often setting the line number to on every time you open vi can become annoying. You would like to have line numbers on by default. The easy way to do so is by ensuring you have a local setting file for vi in your home directory, the file should be named: .vimrc
adding the below content to .vimrc in you home directory will ensure that line numbers are always on when you start vi under Oracle Linux.
[root@localhost ~]# cat ~/.vimrc set number [root@localhost ~]#
This is however only one of many settings you can do to change the default behaviour of vi. When working a lot with vi you might want to dive a bit into the options to influence the default behaviour as it can save you a lot of time.