Built-in text editor in Terminal

vim, emacs, nano and pico are all available by default with OS X 10.7.4:

/Users/ian
> which nano
/usr/bin/nano

/Users/ian
> which vim
/usr/bin/vim

/Users/ian
> which emacs
/usr/bin/emacs

> which pico
/usr/bin/pico

Since ed has not been mentioned yet, even thought I'd choose to use nano over it and the others mentioned, let me offer it as an addition to the cumulative list.

The manual page for ed states:

The ed utility is a line-oriented text editor. It is used to create, display, modify and otherwise manipulate text files.


Since this question is about "built-in" editors "like" nano, this question needs an updated answer:

The command pico is just a symlink to nano, vi is actually vim as is ex and not counting awk or psed, cat, xargs, constructions and the like, thats about it, since ed is indeed present but very unlike nano (depending on the definition of "editor").

Three CLI text editors (like nano) are present in the default of Sierra:

  • nano (installed: 2.0.6, current: 2.8.7. "Of course, you should always check the nano homepage to see what the latest and greatest version is.")

    GNU nano is designed to be a free replacement for the Pico text editor, part of the Pine email suite from The University of Washington. It aims to "emulate Pico as closely as possible and then include extra functionality".

  • vim (installed: Vi IMproved 7.4, current: "Vim 8.0 is the latest stable version")

    Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X.

  • emacs (installed: GNU Emacs 22.1.1, current: "Emacs 25.3 − latest release Released September 11, 2017 Emacs 25.3 fixes a significant security hole.")

    An extensible, customizable, free/libre text editor — and more.


In addition to ones listed above there is also xedit. It's opened from the terminal by just typing xedit. Opens an editor window where you can edit a file with keyboard and mouse.