MATLAB: How to save all command history.

MATLABmatlab function

Hi all, I wanted to save the history of all command window. I try with diary but it save the present what you are working. Is there simple way to export all the command history to txt file ?. I will appreciate your help. Thank you,
Related Question