Previous command

Hi,

i would like to retrieve (only retrieve, not execute) a previous command which i executed on the command prompt. I tried the 'up arrow' key, but its not working. Instead,it showed me some funny characters. I searched around and i found the way to do it was using the way below. Several websites quoted as saying ".. using control key ^P .. ". What keys do i type to get the control P ? I tried shift + P and Ctrl + P, neither worked.

What shell and TERM?

What shell are you using?

On hpux normally it would be Esc+k (previous, previous...) or Esc +j (forward...)

Or you can type history...

I got the following output when i did a

echo $0
/bin/ksh

I suppose its k shell? In this case, what should be the key to retrieve the last command?

:slight_smile:
Hi ,
Can anybody help me for checking the OS error messages in HP-UNIX Servers like /var/adm/messages in linux servers ..

In ksh

if you are in vi mode (i.e. have set -o vi ), use

ESC and k (or ESC and -) to move back, or  
ESC and j to move forward ( or ESC and + ) 

If you have set -o emacs, or gmacs, use

control-p for previous command and 
control-n for next command.

HTH,