Ksh /

Korn Shell History

By default, ksh(8)'s history command only shows the 16 most recent commands. To fix this, change the alias that ksh uses for history:

$ echo "alias history='fc -l 0'" >> ~/.profile
$ . ~/.profile

To apply this system-wide:

# echo "alias history='fc -l 0'" >> /etc/profile
# . /etc/profile

This will show all the entire history when the command is called.

By default, ksh(8) also does not save command history on disk. This can be easily fixed by setting the HISTFILE variable:

$ echo "export HISTFILE=~/.sh_history >> ~/.profile"
$ . ~/.profile

To apply this system-wide:

# echo "export HISTFILE=~/.sh_history >> /etc/profile"
# . /etc/profile