Assuming that your default shell is ksh:
# this only needs to be done once to put ksh in vi edit mode, most put this in their .profile or similar.
$ set -o vi
type <esc> k to bring up the last run command.
$ <esc> k
You can cycle through the previous commands with k and j key, backwards and forward respectively.
Move your cursor over the selected line with h and l, just like in vi and some other vi edit commands like x, i, $ all work.
There are a ton of sites that cover this.
|