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:
nano -l /path/to/file
Where: -l option displays line numbers in the editor (it is shortcut for --linenumbers option).
Screenshot:
Global configuration
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/nanorcfile, e.g.nano /etc/nanorc - find and uncomment the following line:
set linenumbers - save introduced changes.
User configuration
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
~/.nanorcfile, e.g.nano ~/.nanorc - add the following line:
set linenumbers - save introduced changes.
References