How to show line numbers in Nano on Mac


td;lr: On GNU Nano press escape key followed by key n on your Mac to show line numbers.

If you want to display the line numbers at the left-hand side gutter area in Nano editor on the Mac, then you can make use of the Keyboard Command: Esc + n

If for some reason you do not see any line numbers on the file, then you need to be aware that this does not work with the default Nano editor that is available with macOS. You will need to get the GNU version of Nano, you can get it using homebrew.

Install GNU Nano:
brew install nano

Also make sure to add the path to your .zshrc profile file, else you might be again using the default nano editor.

Path:
PATH="/opt/homebrew/bin/nano:$PATH"

Note: The path may vary based on your Mac CPU type M1/M2 or Intel.

Show line numbers in Nano on macOS
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap