Skip to content

Instantly share code, notes, and snippets.

@jnareb
Created June 3, 2016 17:33
Show Gist options
  • Save jnareb/6e56dfab30d6ba018b2c60ca58d48edb to your computer and use it in GitHub Desktop.
Save jnareb/6e56dfab30d6ba018b2c60ca58d48edb to your computer and use it in GitHub Desktop.
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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment