Very often I find myself trying to learn something new which requires from me to run easy-to-forget console/terminal commands.
Sometimes I have to trial-and-error using different commands until I finally get it, which means I may have some difficulty trying to remember what I did next time I want to do it again.
To avoid this I find very useful to save my command line history so I can replay back everything I did step by step.
To do this I just run:
history > history.txt
The above command will save your history to a text file called history.txt
which you can check again later.