20221223

Memory aid: programs installed with sudo apt-get and persistent history with logs


What did I install again? 

$ cat /var/log/apt/history.log |grep '^Commandline' | sort -u


Persistent History with Logs 

# running bash history https://spin.atomicobject.com/2016/05/28/log-bash-history/

export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log; fi'

# must check ~/.logs for full history of all commands since enabling

AND 

https://askubuntu.com/questions/67283/is-it-possible-to-make-writing-to-bash-history-immediate/67306#67306

shopt -s histappend PROMPT_COMMAND='history -a;history -n'

But so many options...?!

No comments:

Post a Comment