EN
Linux - enable line numbers in nano editor
7 points
In this short article we would like to show how to enable line numbers in nano editor under Linux.
Quick solution:
xxxxxxxxxx
1
nano -l /path/to/file
Where: -l
option displays line numbers in the editor (it is shortcut for --linenumbers
option).
Screenshot:

In this section you can find simple way to turn on line numbers in nano
editor for entire operating system.
Simple steps:
- open or create the
/etc/nanorc
file, e.g.xxxxxxxxxx
1nano /etc/nanorc
- find and uncomment the following line:
xxxxxxxxxx
1set linenumbers
- save introduced changes.
In this section you can find simple way to turn on line numbers in nano
editor only for the current user.
Simple steps:
- open or create the
~/.nanorc
file, e.g.xxxxxxxxxx
1nano ~/.nanorc
- add the following line:
xxxxxxxxxx
1set linenumbers
- save introduced changes.
References