Monday, July 12, 2010

How to recall previous commands in Unix

To determine which shell is in use, issue the AIX echo command: echo $SHELL

while in kornshell vi mode (set -o vi) all entered commands are saved the the $HOME/.sh_history file. It's read from the bottom up. Hit esc to enter vi mode on the command line and press k for the previous entered command or go up one line in the .sh_history file if you will. Press j to scroll down the .sh_history file for the next entered command.

Press i to go back to input mode again.