Skip to content

Commit

Permalink
log all bash commands
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsEckart committed Sep 15, 2023
1 parent c419af5 commit eea36f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .bash_prompt
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,6 @@ export PS1;

PS2="\[${yellow}\]→ \[${reset}\]";
export PS2;

# from 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)" >> ~/.dotfiles/logs/bash-history-$(date "+%Y-%m-%d").log; fi'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.secrets
.secrets
logs

0 comments on commit eea36f1

Please sign in to comment.