When I am running my analyses using the bash shell, I often want to save the commands I've used that gave me good results to a file in the same directory (my "LOGBOOK", as its called) so that I can check what I did to get those results. So far this has meant me either copy.pasting the command from the terminal or pressing "up" modifying the command to an
echo"my command" >> LOGBOOK, or other similar antics.
I found there was a
history tool the other day, but I can't find a way of using it to get the previously executed command so that I can do something like
getlast >> LOGBOOK.
Is there a nice easy way to do this. Alternatively, how do others deal with saving the commands for results they have?