If you have attempted to use nano at the command line on MacOS recently, you may have noticed that the pico text editor is launched instead, via a symlink for /usr/bin/nano to pico. This is because the latest versions of MacOS remove the nano text editor from the command line for whatever reason, and instead have replaced nano with pico.
If you prefer to use the nano text editor, you can get nano back in the command line by installing it manually yourself.
The simplest way to install the nano text editor on MacOS is to use Homebrew.
How to Install nano Text Editor on MacOS
If you don’t have Homebrew installed yet, you will need to do that first. Homebrew is easy to install on the Mac and offers simple package management and an abundance of command line tools, apps, and utilities that are familiar to many Unix and Linux users.
Assuming you have Homebrew installed, installing nano on the Mac is super simple.
From the Terminal, type the following syntax:
brew install nano
Once nano has finished installing, you can launch nano as usual from the command line with:
And away you go, you’re back to using the nano text editor at the command line.
The replacement of nano with pico by default arrived with macOS 12.3 and onward, where you will also find that Python 2 was removed, but you can make Python 3 the default on the Mac if desired. While the precise reasons for these changes are unclear, speculation online suggests it may be to get away from GNU licensing issues, or potential security issues. Fortunately thanks to Homebrew, it’s simple to add and replace any deprecated or missing command line tools you may be familiar with and use as part of your workflow, whether it’s nano, python, or anything else.
For what it’s worth, nano is based on pico, so many users won’t even notice the difference between the two text editors, since the commands, keystrokes, interface, etc are the same too, but nano allows for some customizations that pico does not offer.
Did you notice that nano was quietly replaced by pico? Did you replace and install nano, or are you going to stick with pico, or choose something totally different like emacs or vim?