I am running Solaris and I was wondering how to run the last command with ksh. I know that in bash/sh you can do "!!" for the last command and !-N for "N minus the last command." What is the equivalent in KSH? Thank you in advance.
r, or Control + P. Korn shell doesn't implement csh/bash-style history, but you can manipulate the command history with fc (r is an alias for an fc invocation), or with set -o emacs or set -o vi you can use editor commands to search and modify previous commands.
Use fc -s (SOME letter of last executed command)
like if the last executed command was cat sample.txt
use fc -s ca
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With