I am looking for a keyboard shortcut to show the line numbers in nano editor when navigating up and and down within the file.

I have seen in multiple posts about CTRL+C but this doesn't automatically refresh the line number while navigating.

I remember that in the past I have used such shortcut in Linux terminal and if I recall it was for nano. I also think that it worked out of the box, I didn't have to change any parameters like this article shows: https://askubuntu.com/questions/73444/how-to-show-line-numbering-in-nano-when-opening-a-file

Is there any shortcut to do this? I have Ubuntu 16.04 and GNU nano 2.5.3.


You can enable and disable the lines number for each individual line instead through:

ALT + #

see the help (Open nano then type Ctrl + G ):

M-#             Line numbering enable/disable
  • 3
    It might be worth pointing out that this numbers each individual line, rather than constantly displaying the position at the bottom of the screen (as done temporarily by Ctrl+C). – Stephen Kitt May 9 '18 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.