A Brief Tutorial on How to Show Line Numbers in Nano Editor
How to Display Line Numbers in Nano
There are three methods to display line number in nano, and they are as follows:
You can directly use the following command to display line numbers in Nano:
In the above command, you need to write your file's name instead of [filename].
You can press Alt and # or Alt, Shift, and 3 key combinations to display line numbers quickly.
You can compile Nano from the scratch:
git clone git://git.savannah.gnu.org/nano.git;cd nano;./autogen.sh;./configure;sudo make install
Then, in your /.nanorc file, add the following:
# include all the preexisting configs
Using any of the three methods, you can easily set line numbers in your nano editor. Line numbers are important for users to get references on which line they are working on. Enabling them will help them understand and find an error in any of the lines.