o Enter insertion mode opening a new line BELOW current line.
O Enter insertion mode opening a new line ABOVE current line.
h move cursor left one character.
l move cursor right one character.
j move cursor down one line.
k move cursor up one line.
/mumble move cursor forward to next occurrence of 'mumble' in
the text
?mumble move cursor backward to next occurrence of 'mumble'
in the text
n repeat last search (? or / without 'mumble' to search for
will do the same thing)
u undo last change made
^B Scroll back one window.
^F Scroll forward one window.
^U Scroll up one half window.
^D Scroll down one half window.
:w Write to file.
:wq Write to file, and quit.
:q quit.
:q! Quit without saving.
<esc> Leave insertion mode.
NOTE: The four 'arrow' keys almost always work in 'command' or 'insert' mode.
The 'ed' editor.
The 'ed' editor is a line editor. Other than the fact that it is virtually guaranteed to be on any *nix computer, it
has no socially redeeming features, although some applications may need it. A _lot_ of things have been
offered to replace this 'thing' from 1975.
==> Emergency exit from 'ed'
1. type a period on a line by itself, and press <Enter> This gets you to the command mode or prints a line of
text if you were in command mode. 2. type q and press <Enter>. If there were no changes to the file, this
action quits ed. If you then see a '?' this means that the file had changed, and 'ed' is asking if you want to save
the changes. Press q and <Enter> a second time to confirm that you want out.
The 'pico' editor.
'pico' is a part of the Pine mail/news package from the University of Washington (state, USA). It is a very
friendly editor, with one minor failing. It silently inserts a line feed character and wraps the line when it
exceeds (generally) 74 characters. While this is fine while creating mail, news articles, and text notes, it is
often fatal when editing system files. The solution to this problem is simple. Call the program with the −w
option, like this:
Security Quick−Start HOWTO for Red Hat Linux
8.6. Editing Text Files 64
Commenti su questo manuale