Infinit command line history
function precmd() {
    if [ "$(id -u)" -ne 0 ]; then
    FULL_CMD_LOG="$HOME/.logs/zsh-history-$(date -u "+%Y-%m-%d").log"
    echo "$USER@`hostname`:`pwd` [$(date -u)] `\history -1`" >> ${FULL_CMD_LOG}
fi
}Each command will look like:
ahays@:<host>/home/ahays [Thu Nov 29 21:02:22 UTC 2012]   148  cat /path/to/my/favorite/textfileTook from http://blog.andrewhays.net/love-your-terminal
TODO: write a function to extend zsh's history search.
Written by Santiago Gil
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
 #Zsh 
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#

 
 
 
 
