what is the command to see the previously executed command that was run on the command line ?
history -1 will display only the last command. Otherwise,
history will list the last 16 commands (for plain
ksh, but this may differ with other korn-compatible shells).
You can also use the
fc builtin command if you are using plain
ksh (command options are described in the man page).
According to this post, you can use the Up Arrow key once you add the following lines to the bottom of your .kshrc file in your $HOME directory:
set -o emacs alias __A=$(print '\0020') # ^P = up = previous command alias __B=$(print '\0016') # ^N = down = next command alias __C=$(print '\0006') # ^F = right = forward a character alias __D=$(print '\0002') # ^B = left = back a character alias __H=$(print '\0001') # ^A = home = beginning of line
It depends on your shell. If you want to run the last command, in bash for example, you can type
See this page for more info.
Oh well, now I noticed that you had tagged your post ksh. Sorry about that. I'll leave this answer here anyway. Maybe it helps someone someday :)