List of content you will read in this article:
The nano editor is a text editor included in many Unix-based systems. It is a small, lightweight editor that is easy to use and perfect for making simple changes to text files. If you're new to the nano text editor, you may wonder how to show line numbers in Nano. This can be helpful when working with long files or finding a specific line of code.
How to Show Line Numbers in Nano? [Nano Line Numbers]
There are 4 methods to show line numbers in nano, and they are as follows:
You can directly use the following command to display line numbers in Nano:
nano --linenumbers [filename]
nano --linenumbers testfile.txt
You can press Alt +Shift + 3 key combinations to display line numbers quickly.
You can compile Nano from 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 codes, do not worry if this file is empty. This file is not existed by default:
# include all the preexisting configs
You can use CTRL + C to display the current line number.
Also, to display the line & column number, you could just add the
-c parameter when running nano editor:
nano -c [filename]
nano -c testfile.txt
You can easily set line numbers in your nano editor using 4 methods. 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 lines. In this article, we have explained nano show line numbers commands. If you have any questions, you can ask them in the comment box.
People are also reading: