til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Slimming History

I love the history slimming feature in Bash, apparently Zsh has one just like it.

From below StackOverflow post:

The zsh shell doesn’t use the HISTIGNORE environment variable. Instead, it has a HISTORY_IGNORE environment variable.

Example:

HISTORY_IGNORE="(ls|cd|pwd|exit|cd ..|cd -|clear|ls -l|ls -la|git s)"

And more to come as the list will grow.

You could monitor your history for candidates:

tail -n 2000 -f ~/.zsh_history | grep -E '^\w+$'

Resources and References