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

k
ksh(1) ksh(1)
M-# Insert a # at the beginning of the line and execute it. This causes a comment to be
inserted in the history file.
Vi Editing Mode
There are two typing modes. Entering a command puts you into input mode. To edit, the user enters
control mode by pressing
ESC and moves the cursor to the point needing correction, then inserts or
deletes characters or words. Most control commands accept an optional repeat count prior to the com-
mand.
In vi mode on most systems, canonical processing is initially enabled and the command is echoed again if
the speed is 1200 baud or greater and contains any control characters, or if less than one second has
elapsed since the prompt was printed. The
ESC
character terminates canonical processing for the
remainder of the command and the user can then modify the command line. This scheme has the advan-
tages of canonical processing with the type-ahead echoing of raw mode.
Setting the
viraw option always disables canonical processing on the terminal. This mode is implicit for
systems that do not support two alternate end-of-line delimiters, and can be helpful for certain terminals.
Input Edit Commands
By default the editor is in input mode.
erase Delete previous character. (erase is a user-defined erase character, as defined by the
stty(1) command, usually ˆH or #.)
ˆW Delete the previous blank separated word.
ˆD Terminate the shell.
ˆV Escape next character. Editing characters, erase or kill characters can be entered in a
command line or in a search string if preceded by a ˆV. ˆV removes the next
character’s editing features (if any).
\ Escape the next erase or kill character.
Motion Edit Commands
These commands move the cursor. The designation [count] causes a repetition of the command the cited
number of times.
[count]l Cursor forward (right) one character.
[count]w Cursor forward one alphanumeric word.
[count]W Cursor to the beginning of the next word that follows a blank.
[count]e Cursor to end of word.
[count]E Cursor to end of the current blank-delimited word.
[count]h Cursor backward (left) one character.
[count]b Cursor backward one word.
[count]B Cursor to preceding blank separated word.
[count]| Cursor to column count. Default is 1.
[count]fc Find the next character c in the current line.
[count]Fc Find the previous character c in the current line.
[count]tc Equivalent to f followed by h.
[count]Tc Equivalent to F followed by l.
[count]; Repeats the last single character find command, f, F, t,orT.
[count], Reverses the last single character find command.
0 Cursor to start of line.
^ Cursor to first nonblank character in line.
$ Cursor to end of line.
Search Edit Commands
These commands access your command history.
[count]k Fetch previous command. Each time k is pressed, the next earlier command in
the history list is accessed.
[count]- Equivalent to k.
[count]j Fetch next command. Each time j is entered, the next later command in the
history list is accessed.
[count]+ Equivalent to j.
[count]G The command number count is fetched. The default is the first command in the
history list.
/string Search backward through history for a previous command containing string.
string is terminated by a "Return" or "New-line". If string is preceded by a ˆ, the
Section 1422 Hewlett-Packard Company 20 HP-UX 11i Version 2: August 2003