We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Linux Editors
What is a text editor?
o A text editor is a program which enables you to create and manipulate character data (text) in a computer file. o A text editor is not a word processor although some text editors do include word processing facilities. o Text editors often require "memorizing" commands in order to perform editing tasks. The more you use them, the easier it becomes. There is a "learning curve" in most cases though. There are several standard text editors available on most LINUX systems: o ed - standard line editor o ex - extended line editor o vi - a visual editor; full screen; uses ed/ex line-mode commands for global file editing o sed - stream editor for batch processing of files In addition to these, other local "favorites" may be available: o emacs - a full screen editor and much more o pico - an easy "beginner's" editor o lots of others
The Standard Display Editor - vi
vi supplies commands for:
o inserting and deleting text o replacing text o moving around the file o finding and substituting strings o cutting and pasting text o reading and writing to other files vi uses a "buffer" o While using vi to edit an existing file, you are actually working on a copy of the file that is held in a temporary buffer in your computer's memory. o If you invoked vi with a new filename, (or no file name) the contents of the file only exist in this buffer. o Saving a file writes the contents of this buffer to a disk file, replacing its contents. You can write the buffer to a new file or to some other file. o You can also decide not to write the contents of the buffer, and leave your original file unchanged. vi operates in two different "modes": o Command mode vi starts up in this mode Whatever you type is interpreted as a command - not text to be inserted into the file. The mode you need to be in if you want to "move around" the file. o Insert mode This is the mode you use to type (insert) text. There are several commands that you can use to enter this mode. Once in this mode, whatever you type is interpreted as text to be included in the file. You cannot "move around" the file in this mode. Must press the ESC (escape) key to exit this mode and return to command mode.