Created
June 3, 2016 17:33
-
-
Save jnareb/6e56dfab30d6ba018b2c60ca58d48edb to your computer and use it in GitHub Desktop.
Log Your Entire Bash History: https://spin.atomicobject.com/2016/05/28/log-bash-history/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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