Skip to content

Instantly share code, notes, and snippets.

@rizkylab
Created April 12, 2022 01:30
Show Gist options
  • Save rizkylab/8ab4fe30c8539c835f6e9f90f83a4f3f to your computer and use it in GitHub Desktop.
Save rizkylab/8ab4fe30c8539c835f6e9f90f83a4f3f to your computer and use it in GitHub Desktop.
bash history log all commands to syslog
PROMPT_COMMAND='history -a >(tee -a ~/.bash_history | logger -t "$USER[$$] $SSH_CONNECTION")'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment