How do you reinstall nano on Mac OS X?

  1. Download the nano source (I recommend the tar.xz one) (nano-editor.org/download.php)
  2. Go to the folder it was downloaded to (By default it downloads to ~/Downloads but if you changed the directory where files download then just go there).
  3. Extract the nano source you downloaded.
  4. Open your terminal
  5. Type "cd " without the "" then drag and drop the folder you extracted and click enter.
  6. run "./configure" without the "".
  7. run "make" without the "".
  8. run "sudo make install" without the "".]

You have now successfully installed nano!


Update: The answer below is no longer accurate. As of Apr 4, 2017, the formulae were moved to homebrew/core. See https://github.com/Homebrew/homebrew-dupes/commits/master/README.md


The reason you can't find it in homebrew is because homebrew's main repo doesn't include programs that come with the OS. You have to add an additional repo:

brew tap homebrew/dupes
brew install nano

https://github.com/Homebrew/homebrew-dupes