What am I running inside my bash? (2014)
Modern shells are powerful enough to help you remember, if you learn to configure them appropriately. My histories are always saved because each shell instance gets its own HISTFILE, like so:<p><pre><code>  export HISTFILE=$HOME/.history/${TTY##\*/}.$SHLVL
</code></pre>
As I use different terminal windows for different tasks, this keeps history files rather concise thematically.<p>And I let the shell add timestamps too, so I can grep for entries produced during a certain time span:<p>zsh:<p><pre><code>  setopt EXTENDEDHISTORY # add timestamps
</code></pre>
bash:<p><pre><code>  HISTTIMEFORMAT="%F %T "
</code></pre>
I write perl or shell script files, of course, if it's more than some a handful of lines.