Unix command to see the last run command on command line

kshunix

what is the command to see the previously executed command that was run on the command line
?

Best Answer

use the history command.

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).

Related Question