The Nano Editor is the most famous text editor for the console after vi/vim. What makes it popular is the ease of use.
By default you will not see a gutter area with line numbers when you open a file with Nano, there are multiple ways in which we can enable line numbers in Nano, let's take a look at a few of them.
Using the --linenumbers or -l flag
When you open a file, just add --linenumbers to it.
nano --linenumbers datafile.txt
or,
nano -l datafile.txt
Toggle Line Numbers
If you have already opened a file using nano, and you want to display the line numbers, then you can toggle line numbers as follows,
On macOS
Esc + n
On Windows
Alt + Shift + 3
Alt + #
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
Thanks for your feedback! If you have time, please provide details by selecting options below.
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!