Nano Configuration File
Alternatively, you can make line numbering permanent by modifying the Nano configuration file. Follow these steps:
Step 1: Open Nano Configuration File
sudo nano /etc/nanorc
Add set linenumbers in the nanorc file
Now if we create any nano file we will automatically see the line numbers.
nano example.txt
How to Show Line Numbers in Nano Editor?
Nano is a popular and user-friendly text editor available on Unix-based systems, known for its simplicity and ease of use. While Nano provides essential features for text editing, such as syntax highlighting and search functionality, showing line numbers by default isn’t one of them. However, it’s possible to enable line numbering in Nano, which can be particularly helpful for referencing specific lines or debugging code. In this article, we’ll explore different methods to show line numbers in Nano editor with multiple examples and their explanations.