This is the feature I've been looking for:
"log exit code, cwd, hostname, session, command duration, etc"
"log exit code, cwd, hostname, session, command duration, etc"
export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/stuff/logs/bash-history-$(date "+%Y-%m-%d").log; fi'
makes files like stuff/logs/bash-history-2023-05-06.log
that contain 2023-05-06.11:42:38 /home/dv 3737 2023-05-06 11:42:38 cat .bashrc
then you can make some commands to grep through thisOne day, you could search for that AWS cli command run specifically on AWS_ACCOUNT_ID=foo