Hacker News new | past | comments | ask | show | jobs | submit login

Just for those out there using zsh or fish I used to following in my .zshrc to get this working:

    precmd() {
        eval 'if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history | tail -n 1)" >>! ~/Dropbox/Logs/Bash/Macbook/bash-history-$(date "+%Y-%m-%d").log; fi'
    }
I Store my logs in dropbox but you can put them wherever



Thanks so much!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: