HP-UX Reference (11i v2 04/09) - 1 User Commands A-M (vol 1)

k
ksh(1) ksh(1)
Emacs Editing Mode
This mode is invoked by either the
emacs or gmacs option. Their sole difference is their handling of
ˆT. To edit, the user moves the cursor to the point needing correction and inserts or deletes characters or
words. All editing commands are control characters or escape sequences. The notation for control char-
acters is circumflex (ˆ) followed by the character. For example,
ˆF is the notation for Ctrl-F. This is
entered by pressing the
f key while holding down the Ctrl (control) key. The Shift key is not pressed.
(The notation
ˆ? indicates the DEL (delete) key.)
The notation for escape sequences is
M-
followed by a character. For example, M-f (pronounced Meta f)
is entered by depressing ESC (ASCII 033 ) followed by f.
M-F would be the notation for ESC followed by
Shift (capital) F.
All edit commands operate from any place on the line (not only at the beginning). Neither the Return
nor the Line Feed key is entered after edit commands, except when noted.
ˆF Move cursor forward (right) one character.
M-f Move cursor forward one word. (The editor’s idea of a word is a string of characters con-
sisting of only letters, digits and underscores.)
ˆB Move cursor backward (left) one character.
M-b Move cursor backward one word.
ˆA Move cursor to start of line.
ˆE Move cursor to end of line.
ˆ]char Move cursor forward to character char on current line.
M-ˆ]char Move cursor backward to character char on current line.
ˆXˆX Interchange the cursor and mark.
erase (User defined erase character as defined by the stty(1) command, usually
ˆH or #.)
Delete previous character.
ˆD Delete current character.
eof End-of-file character, normally ˆD, terminates the shell if the current line is null.
M-d Delete current word.
M-ˆH (Meta-backspace) Delete previous word.
M-h Delete previous word.
M-ˆ? (Meta-DEL) Delete previous word. If interrupt character is ˆ? (DEL, the default) this
command does not work.
ˆT Transpose current character with next character in emacs
mode. Transpose two previ-
ous characters in
gmacs mode.
ˆC Capitalize current character.
M-c Capitalize current word.
M-l Change the current word to lowercase.
ˆK Delete from the cursor to the end of the line. If preceded by a numerical parameter
whose value is less that the current cursor position, delete from the given position up to
the cursor. If preceded by a numerical parameter whose value is greater than the
current cursor position, from the cursor up to the given position.
ˆW Kill from the cursor to the mark.
M-p Push the region from the cursor to the mark on the stack.
kill (User-defined kill character, as defined by the stty(1) command, usually ˆG or @.) Kill
the entire current line. If two kill characters are entered in succession, all subsequent
consecutive kill characters cause a line feed (useful when using paper terminals).
ˆY Restore last item removed from line (yank item back to the line).
ˆL Line feed and print current line.
@ (Null character) Set mark.
M-space (Meta space) Set mark.
ˆJ (Newline) Execute the current line.
ˆM (Return) Execute the current line.
ˆP Fetch previous command. Each time ˆP is entered, the next previous command in the
history list is accessed.
ˆN Fetch next command. Each time ˆN is entered the next command in the history list is
accessed.
M-< Fetch the least recent (oldest) history line.
M-> Fetch the most recent (youngest) history line.
ˆRstring Reverse search history for a previous command line containing string. If a parameter of
zero is given, the search is forward. string is terminated by a Return or Newline.If
string is preceded by a ˆ, the matched line must begin with string.Ifstring is omitted,
the next command line containing the most recent string is accessed. In this case a
HP-UX 11i Version 2: September 2004 19 Hewlett-Packard Company Section 1439