Skip to content

Instantly share code, notes, and snippets.

@daithi-coombes
Created October 7, 2015 09:43
Show Gist options
  • Save daithi-coombes/bc1b3cafc2c1e2c7ba3b to your computer and use it in GitHub Desktop.
Save daithi-coombes/bc1b3cafc2c1e2c7ba3b to your computer and use it in GitHub Desktop.
log terminal directory changes & timestamp
tail -fn0 ~/.bash_history | awk -v date="$(date +"%Y-%m-%d %r")" '/^cd .*$/ { print date, $2| "tee /var/log/terminal-cd.log" }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment