You could read in the history file, e.g. .bash_history or whatever file for shell you're using.
In reply to Re^2: command line history? by vlsimpson in thread command line history? by brp4h