To move back up the list one command at a time:
1 ls 2 pwd 3 grep Smith address.txt > smiffs.tmp 4 sort -u post smiff.tmp 5 lp post 6 lpstat ^P lpstat ^P lp post ^P sort -u post smiff.tmp
This takes us back up to command 4. Entering further CTRL-P commands takes you further up the command history.
To to move down the command list carrying on from the example above:
^N lp post ^N lpstat
This moves us back down to command 6. Entering further CTRL-S commands takes you down the command history.
To search up the command history:
^R (reverse-i-search)`sort': sort -u post smiff.tmp
This searches up the command list for the first command containing the string sort. Repeating CTRL-R continues the search up the command history.
Once found you can edit the command line.
To search down the command list:
^S (i-search)`grep': grep Smith address.txt > smiffs.tmp
This searches down the command list for the first command containing the string lp. Repeating CTRL-S continues the search down the command history.
Once found you can edit the command line.