Ex (text editor)


ex is a line editor based on and intended as an improvement to ed, the original Unix editor. Today, it is standardized by POSIX.
George Coulouris of Queen Mary College developed an improved version of ed called em in 1975 that took advantage of video terminals. While visiting Berkeley, Coulouris presented em to Bill Joy, who modified it along with Charles Haley to be less demanding of the processor. The editor became ex and got included in the Berkeley Software Distribution.
Later, ex was enhanced to support full-screen editing via a new, visual mode. The vi text editor is, in fact, ex running in visual mode. The computer [program | program] can be started in either the visual or legacy mode and the user can switch between modes at runtime. And, in visual mode, ex commands can be issued at the colon prompt. Even though vi is just a mode of ex, the editor is more commonly called vi today instead of ex. In fact, some programs such as vim provide both vi and ex compatibility modes such that neither vi nor ex are the program per se.
The core ex commands which relate to search and replace are essential to vi. For instance, the ex command replaces every instance of with, and works in vi too. The means every line in the file. The 'g' stands for global and means replace every instance on every line.